Sha256: 841fbccc1afdf7d33756c5d0973237d82aca20dd3a2fa850adedb00e222ffae1

Contents?: true

Size: 1.17 KB

Versions: 9

Compression:

Stored size: 1.17 KB

Contents

# Adapted from Airbrake code https://github.com/airbrake/airbrake/blob/master/lib/airbrake/rails.rb
require 'yogi_berra'
require 'yogi_berra/action_controller_catcher'

module YogiBerra
  def self.initialize
    if defined?(ActionController::Base)
      ActionController::Base.send(:include, YogiBerra::ActionControllerCatcher)
      # ActionController::Base.send(:include, YogiBerra::::ErrorLookup)
      # ActionController::Base.send(:include, YogiBerra::ControllerMethods)
      # ActionController::Base.send(:include, YogiBerra::JavascriptNotifier)
    end

    rails_logger = if defined?(::Rails.logger)
                     ::Rails.logger
                   elsif defined?(RAILS_DEFAULT_LOGGER)
                     RAILS_DEFAULT_LOGGER
                   end

    if defined?(::Rails.configuration) && ::Rails.configuration.respond_to?(:middleware)
      ::Rails.configuration.middleware.insert_after('ActionController::Failsafe', YogiBerra::ExceptionMiddleware)
      # ::Rails.configuration.middleware.insert_after 'Rack::Lock',
      #                                               YogiBerra::UserInformer
    end
  end
end

YogiBerra::Catcher.quick_connection(true)
YogiBerra.initialize

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
yogi_berra-0.0.15 lib/yogi_berra/rails.rb
yogi_berra-0.0.14 lib/yogi_berra/rails.rb
yogi_berra-0.0.13 lib/yogi_berra/rails.rb
yogi_berra-0.0.12 lib/yogi_berra/rails.rb
yogi_berra-0.0.11 lib/yogi_berra/rails.rb
yogi_berra-0.0.10 lib/yogi_berra/rails.rb
yogi_berra-0.0.9 lib/yogi_berra/rails.rb
yogi_berra-0.0.8 lib/yogi_berra/rails.rb
yogi_berra-0.0.6 lib/yogi_berra/rails.rb