Class: Yeller::Rails

Inherits:
Object
  • Object
show all
Defined in:
lib/yeller/rails.rb

Defined Under Namespace

Modules: ControllerMethods, Rails2CatchingHooks, Rails3AndFourCatchingHooks Classes: Railtie

Class Method Summary collapse

Class Method Details

.clientObject



29
30
31
# File 'lib/yeller/rails.rb', line 29

def self.client
  Yeller::Rack.client
end

.configure(&block) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/yeller/rails.rb', line 9

def self.configure(&block)
  Yeller::Rack.configure do |config|
    if defined?(::Rails)
      config.error_handler = Yeller::LogErrorHandler.new(::Rails.logger)
      config.environment = ::Rails.env.to_s
    elsif ENV['RAILS_ENV']
      config.environment = ENV['RAILS_ENV']
    end
    block.call(config)
  end
end

.enabled?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/yeller/rails.rb', line 21

def self.enabled?
  Yeller::Rack.enabled?
end

.monkeypatch_rails3!Object



152
153
154
155
156
157
158
159
160
161
162
# File 'lib/yeller/rails.rb', line 152

def self.monkeypatch_rails3!
  if defined?(::ActionDispatch::DebugExceptions)
    ::ActionDispatch::DebugExceptions.send(:include, Yeller::Rails::Rails3AndFourCatchingHooks)
  elsif defined?(::ActionDispatch::ShowExceptions)
    ::ActionDispatch::ShowExceptions.send(:include, Yeller::Rails::Rails3AndFourCatchingHooks)
  end

  if defined?(::ActionController)
    ::ActionController::Base.send(:include, Yeller::Rails::ControllerMethods)
  end
end

.report(exception, options = {}) ⇒ Object



25
26
27
# File 'lib/yeller/rails.rb', line 25

def self.report(exception, options={})
  Yeller::Rack.report(exception, options)
end