Sha256: 340414431269c59a92377a1ee10b0b3fa5a1ab1268533ad059f34029b4300836

Contents?: true

Size: 1.17 KB

Versions: 37

Compression:

Stored size: 1.17 KB

Contents

require 'rails'
require 'rollbar'

module Rollbar
  class Railtie < ::Rails::Railtie
    rake_tasks do
      require 'rollbar/rake_tasks'
    end

    config.after_initialize do
      Rollbar.configure do |config|
        config.logger ||= ::Rails.logger
        config.environment ||= ::Rails.env
        config.root ||= ::Rails.root
        config.framework = "Rails: #{::Rails::VERSION::STRING}"
        config.filepath ||= ::Rails.application.class.parent_name + '.rollbar'
      end

      ActiveSupport.on_load(:action_controller) do
        # lazily load action_controller methods
        require 'rollbar/rails/controller_methods'
        include Rollbar::Rails::ControllerMethods
      end

      if defined?(ActionDispatch::DebugExceptions)
        # Rails 3.2.x
        require 'rollbar/middleware/rails/show_exceptions'
        ActionDispatch::DebugExceptions.send(:include, Rollbar::Middleware::Rails::ShowExceptions)
      elsif defined?(ActionDispatch::ShowExceptions)
        # Rails 3.0.x and 3.1.x
        require 'rollbar/middleware/rails/show_exceptions'
        ActionDispatch::ShowExceptions.send(:include, Rollbar::Middleware::Rails::ShowExceptions)
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
rollbar-0.9.13 lib/rollbar/railtie.rb
rollbar-0.9.12 lib/rollbar/railtie.rb
rollbar-0.9.11 lib/rollbar/railtie.rb
rollbar-0.9.10 lib/rollbar/railtie.rb
rollbar-0.9.9 lib/rollbar/railtie.rb
rollbar-0.9.8 lib/rollbar/railtie.rb
rollbar-0.9.7 lib/rollbar/railtie.rb
rollbar-0.9.6 lib/rollbar/railtie.rb
rollbar-0.9.4 lib/rollbar/railtie.rb
rollbar-0.9.3 lib/rollbar/railtie.rb
rollbar-0.9.2 lib/rollbar/railtie.rb
rollbar-0.9.1 lib/rollbar/railtie.rb
rollbar-0.9.0 lib/rollbar/railtie.rb
rollbar-0.8.3 lib/rollbar/railtie.rb
rollbar-0.8.2 lib/rollbar/railtie.rb
rollbar-0.8.1 lib/rollbar/railtie.rb
rollbar-0.8.0 lib/rollbar/railtie.rb