Sha256: 6b8a5b6f88e6ff3d29aa6cd661ffc0e981a80e56d70382494babb841fd013cbd

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 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.initialize

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yogi_berra-0.0.1 lib/yogi_berra/rails.rb