Sha256: de47da665e4b664c0611354b2e13bbbc66e271e790590d95d7462672ade2a0a5

Contents?: true

Size: 880 Bytes

Versions: 2

Compression:

Stored size: 880 Bytes

Contents

# Rails 3.x support

require "bugsnag"
require "rails"

module Bugsnag
  class Railtie < Rails::Railtie
    rake_tasks do
      load "tasks/bugsnag.rake"
    end

    initializer "bugsnag.use_rack_middleware" do |app|
      begin
        app.config.middleware.insert_after ActionDispatch::DebugExceptions, "Bugsnag::Rack"
      rescue
        app.config.middleware.use "Bugsnag::Rack"
      end
    end

    config.after_initialize do
      Bugsnag.configure do |config|
        config.release_stage = ::Rails.env
        config.project_root = ::Rails.root
        config.framework = "Rails: #{::Rails::VERSION::STRING}"

        config.logger ||= ::Rails.logger
      end

      if defined?(::ActionController::Base)
        require "bugsnag/rails/controller_methods"
        ::ActionController::Base.send(:include, Bugsnag::Rails::ControllerMethods)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bugsnag-1.1.5 lib/bugsnag/railtie.rb
bugsnag-1.1.4 lib/bugsnag/railtie.rb