Module: Middleman::CoreExtensions::ShowExceptions

Defined in:
lib/middleman-core/core_extensions/show_exceptions.rb

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object

Once registered



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/middleman-core/core_extensions/show_exceptions.rb', line 11

def registered(app)
  # Whether to catch and display exceptions
  # @return [Boolean]
  app.config.define_setting :show_exceptions, true, 'Whether to catch and display exceptions'

  # When in dev
  app.configure :development do
    # Include middlemare
    use ::Rack::ShowExceptions if config[:show_exceptions]
  end
end