Sha256: 364e55c29d3615095523ff7c0bc99b1b2ec6e7437d71dbf8748031ce77953437

Contents?: true

Size: 988 Bytes

Versions: 16

Compression:

Stored size: 988 Bytes

Contents

# Rails 2.x support

require "bugsnag"
require "bugsnag/rails/controller_methods"
require "bugsnag/rails/action_controller_rescue"

module Bugsnag
  module Rails
    def self.initialize
      if defined?(ActionController::Base)
        ActionController::Base.send(:include, Bugsnag::Rails::ActionControllerRescue)
        ActionController::Base.send(:include, Bugsnag::Rails::ControllerMethods)
      end

      # Try to find where to log to
      rails_logger = nil
      if defined?(::Rails.logger)
        rails_logger = ::Rails.logger
      elsif defined?(RAILS_DEFAULT_LOGGER)
        rails_logger = RAILS_DEFAULT_LOGGER
      end

      Bugsnag.configure do |config|
        config.logger = rails_logger
        config.release_stage = RAILS_ENV  if defined?(RAILS_ENV)
        config.project_root = RAILS_ROOT if defined?(RAILS_ROOT)
        config.framework = "Rails: #{::Rails::VERSION::STRING}" if defined?(::Rails::VERSION)
      end
    end
  end
end

Bugsnag::Rails.initialize

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
bugsnag-1.1.5 lib/bugsnag/rails.rb
bugsnag-1.1.4 lib/bugsnag/rails.rb
bugsnag-1.1.3 lib/bugsnag/rails.rb
bugsnag-1.1.2 lib/bugsnag/rails.rb
bugsnag-1.1.1 lib/bugsnag/rails.rb
bugsnag-1.1.0 lib/bugsnag/rails.rb
bugsnag-1.0.10 lib/bugsnag/rails.rb
bugsnag-1.0.9 lib/bugsnag/rails.rb
bugsnag-1.0.8 lib/bugsnag/rails.rb
bugsnag-1.0.7 lib/bugsnag/rails.rb
bugsnag-1.0.6 lib/bugsnag/rails.rb
bugsnag-1.0.5 lib/bugsnag/rails.rb
bugsnag-1.0.4 lib/bugsnag/rails.rb
bugsnag-1.0.3 lib/bugsnag/rails.rb
bugsnag-1.0.2 lib/bugsnag/rails.rb
bugsnag-1.0.1 lib/bugsnag/rails.rb