Sha256: a30cab429076612dc31289081d358debbad88cc4695ebb564be184f7357fbd0f

Contents?: true

Size: 1010 Bytes

Versions: 7

Compression:

Stored size: 1010 Bytes

Contents

require 'airbrake'
require 'rails'

module Airbrake
  class Railtie < Rails::Railtie
    rake_tasks do
      require 'airbrake/rake_handler'
      require "airbrake/rails3_tasks"
    end

    initializer "airbrake.use_rack_middleware" do |app|
      app.config.middleware.use "Airbrake::Rack"
      app.config.middleware.insert 0, "Airbrake::UserInformer"
    end

    config.after_initialize do
      Airbrake.configure(true) do |config|
        config.logger           ||= Rails.logger
        config.environment_name ||= Rails.env
        config.project_root     ||= Rails.root
        config.framework        = "Rails: #{::Rails::VERSION::STRING}"
      end

      if defined?(::ActionController::Base)
        require 'airbrake/rails/javascript_notifier'
        require 'airbrake/rails/controller_methods'

        ::ActionController::Base.send(:include, Airbrake::Rails::ControllerMethods)
        ::ActionController::Base.send(:include, Airbrake::Rails::JavascriptNotifier)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
airbrake-3.0.4 lib/airbrake/railtie.rb
airbrake-3.0.3 lib/airbrake/railtie.rb
airbrake-3.0.2 lib/airbrake/railtie.rb
airbrake-3.0.1 lib/airbrake/railtie.rb
airbrake-3.0 lib/airbrake/railtie.rb
airbrake-3.0.rc2 lib/airbrake/railtie.rb
airbrake-3.0.rc1 lib/airbrake/railtie.rb