Sha256: 55c8244e5fba0ce203faab5bf32887f2e7b4a984d2e3d70d7bd89a074942fa7e

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

require 'raven'
require 'rails'

module Raven
  class Railtie < ::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/rails/controller_methods'
        include Raven::Rails::ControllerMethods
      end
    end

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

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

    rake_tasks do
      require 'raven/tasks'
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
sentry-raven-0.12.0 lib/raven/railtie.rb
mustwin-sentry-raven-0.11.2 lib/raven/railtie.rb
sentry-raven-0.11.2 lib/raven/railtie.rb
sentry-raven-0.11.1 lib/raven/railtie.rb
sentry-raven-0.10.1 lib/raven/railtie.rb