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



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/middleman-core/core_extensions/show_exceptions.rb', line 13

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
    if config[:show_exceptions]
      use ::Rack::ShowExceptions
    end
  end
end