Sha256: 78783c7e6900df30af634470065bd53dfc5f1121a5d0f3b239ccb7c02d0c280c

Contents?: true

Size: 1.2 KB

Versions: 4

Compression:

Stored size: 1.2 KB

Contents

require 'raven'
require 'rails'

module Raven
  class Rails < ::Rails::Railtie
    initializer "raven.use_rack_middleware" do |app|
      app.config.middleware.insert 0, "Raven::Rack"
    end

    initializer 'raven.action_controller' do
      ActiveSupport.on_load :action_controller do
        require 'raven/integrations/rails/controller_methods'
        include Raven::Rails::ControllerMethods
      end
    end

    config.after_initialize do
      Raven.configure do |config|
        config.logger ||= ::Rails.logger
        config.project_root ||= ::Rails.root
      end

      if Raven.configuration.catch_debugged_exceptions
        if defined?(::ActionDispatch::DebugExceptions)
          require 'raven/integrations/rails/middleware/debug_exceptions_catcher'
          ::ActionDispatch::DebugExceptions.send(:include, Raven::Rails::Middleware::DebugExceptionsCatcher)
        elsif defined?(::ActionDispatch::ShowExceptions)
          require 'raven/integrations/rails/middleware/debug_exceptions_catcher'
          ::ActionDispatch::ShowExceptions.send(:include, Raven::Rails::Middleware::DebugExceptionsCatcher)
        end
      end
    end

    rake_tasks do
      require 'raven/integrations/tasks'
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sentry-raven-0.13.3 lib/raven/integrations/rails.rb
sentry-raven-0.13.2 lib/raven/integrations/rails.rb
sentry-raven-0.13.1 lib/raven/integrations/rails.rb
sentry-raven-0.13.0 lib/raven/integrations/rails.rb