middleman/middleman-core/lib/middleman-core/core_extensions/show_exceptions.rb
2014-07-11 09:22:53 -07:00

17 lines
454 B
Ruby

require 'rack/showexceptions'
# Support rack/showexceptions during development
module Middleman::CoreExtensions
class ShowExceptions < ::Middleman::Extension
def initialize(app, options_hash={}, &block)
super
app.config.define_setting :show_exceptions, !!ENV['TEST'], 'Whether to catch and display exceptions'
end
def after_configuration
app.use ::Rack::ShowExceptions if app.config[:show_exceptions]
end
end
end