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

22 lines
581 B
Ruby
Raw Normal View History

2012-01-14 21:18:39 +01:00
# Support rack/showexceptions during development
module Middleman
module CoreExtensions
module ShowExceptions
2014-01-01 23:50:42 +01:00
def self.included(app)
# Require lib
require 'rack/showexceptions'
2014-01-01 23:50:42 +01:00
# Whether to catch and display exceptions
# @return [Boolean]
app.config.define_setting :show_exceptions, true, 'Whether to catch and display exceptions'
2014-01-01 23:50:42 +01:00
# When in dev
app.configure :development do
# Include middlemare
2014-04-29 20:43:05 +02:00
use ::Rack::ShowExceptions if config[:show_exceptions]
end
end
end
end
end