Class: Middleman::CoreExtensions::ShowExceptions
- Defined in:
- lib/middleman-core/core_extensions/show_exceptions.rb
Constant Summary
Constants included from Contracts
Instance Attribute Summary
Attributes inherited from Extension
Instance Method Summary collapse
-
#initialize(app, options_hash = {}, &block) ⇒ ShowExceptions
constructor
A new instance of ShowExceptions.
- #ready ⇒ Object
Methods inherited from Extension
activated_extension, #add_exposed_to_context, #after_build, #after_configuration, after_extension_activated, #after_extension_activated, #before_build, #before_configuration, clear_after_extension_callbacks, config, expose_to_application, expose_to_config, expose_to_template, helpers, #manipulate_resource_list, option, resources
Methods included from Contracts
Constructor Details
#initialize(app, options_hash = {}, &block) ⇒ ShowExceptions
Returns a new instance of ShowExceptions.
6 7 8 9 10 11 12 |
# File 'lib/middleman-core/core_extensions/show_exceptions.rb', line 6 def initialize(app, ={}, &block) super return if app.config.defines_setting? :show_exceptions app.config.define_setting :show_exceptions, ENV['TEST'] ? false : true, 'Whether to catch and display exceptions' end |
Instance Method Details
#ready ⇒ Object
14 15 16 |
# File 'lib/middleman-core/core_extensions/show_exceptions.rb', line 14 def ready app.use ::Rack::ShowExceptions if !app.build? && app.config[:show_exceptions] end |