Class: Middleman::CoreExtensions::ShowExceptions

Inherits:
Extension
  • Object
show all
Defined in:
middleman-core/lib/middleman-core/core_extensions/show_exceptions.rb

Constant Summary

Constant Summary

Constants included from Contracts

Contracts::PATH_MATCHER, Contracts::ResourceList

Instance Attribute Summary

Attributes inherited from Extension

#app, #options

Instance Method Summary (collapse)

Methods inherited from Extension

activated_extension, #after_build, #after_extension_activated, after_extension_activated, #before_build, #before_configuration, clear_after_extension_callbacks, config, helpers, option

Methods included from Contracts

#Contract

Constructor Details

- (ShowExceptions) initialize(app, options_hash = {}, &block)



6
7
8
9
10
11
12
# File 'middleman-core/lib/middleman-core/core_extensions/show_exceptions.rb', line 6

def initialize(app, options_hash={}, &block)
  super

  return if app.config.defines_setting? :show_exceptions

  app.config.define_setting :show_exceptions, !!ENV['TEST'], 'Whether to catch and display exceptions'
end

Instance Method Details

- (Object) after_configuration



14
15
16
# File 'middleman-core/lib/middleman-core/core_extensions/show_exceptions.rb', line 14

def after_configuration
  app.use ::Rack::ShowExceptions if app.config[:show_exceptions]
end