2014-06-14 22:05:32 +02:00
|
|
|
require 'rack/showexceptions'
|
|
|
|
|
2012-01-14 21:18:39 +01:00
|
|
|
# Support rack/showexceptions during development
|
2014-06-07 00:32:00 +02:00
|
|
|
module Middleman::CoreExtensions
|
|
|
|
class ShowExceptions < ::Middleman::Extension
|
2016-01-13 01:03:23 +01:00
|
|
|
define_setting :show_exceptions, ENV['TEST'] ? false : true, 'Whether to catch and display exceptions'
|
2012-10-14 07:37:24 +02:00
|
|
|
|
2015-08-21 02:45:18 +02:00
|
|
|
def ready
|
2014-06-29 00:07:43 +02:00
|
|
|
app.use ::Rack::ShowExceptions if !app.build? && app.config[:show_exceptions]
|
2012-05-07 23:41:39 +02:00
|
|
|
end
|
2011-12-09 20:11:17 +01:00
|
|
|
end
|
2012-08-14 00:39:06 +02:00
|
|
|
end
|