middleman/middleman-core/lib/middleman-core/core_extensions/show_exceptions.rb

13 lines
385 B
Ruby
Raw Normal View History

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'
def ready
2014-06-29 00:07:43 +02:00
app.use ::Rack::ShowExceptions if !app.build? && app.config[:show_exceptions]
end
end
end