module Gaffe

Constants

VERSION

Public Class Methods

configuration() click to toggle source

Return the configuration settings

# File lib/gaffe.rb, line 15
def self.configuration
  @configuration ||= OpenStruct.new
end
configure() { |configuration| ... } click to toggle source

Yield a block to populate @configuration

# File lib/gaffe.rb, line 10
def self.configure
  yield configuration
end
enable!() click to toggle source

Configure Rails to use our code when encountering exceptions

# File lib/gaffe.rb, line 20
def self.enable!
  Rails.application.config.exceptions_app = lambda do |env|
    Gaffe.errors_controller_for_request(env).action(:show).call(env)
  end
end
errors_controller_for_request(env) click to toggle source

Return the right errors controller to use for the request that triggered the error

# File lib/gaffe.rb, line 28
def self.errors_controller_for_request(env)
  resolver = ErrorsControllerResolver.new(env)
  resolver.resolved_controller
end
root() click to toggle source

Return the root path of the gem

# File lib/gaffe.rb, line 34
def self.root
  Pathname.new(File.expand_path('../../', __FILE__))
end