Sha256: 7df0bbb395105ed37144295b90f7d25ca768cdc784546a16448b713fd24f62d2

Contents?: true

Size: 1.1 KB

Versions: 13

Compression:

Stored size: 1.1 KB

Contents

require 'rails'
require 'yaml'

require 'honeybadger/ruby'

module Honeybadger
  module Init
    module Rails
      class Railtie < ::Rails::Railtie
        rake_tasks do
          load 'honeybadger/tasks.rb'
        end

        initializer 'honeybadger.install_middleware' do |app|
          app.config.middleware.insert(0, Honeybadger::Rack::ErrorNotifier)
          app.config.middleware.insert_before(Honeybadger::Rack::ErrorNotifier, Honeybadger::Rack::UserInformer)
          app.config.middleware.insert_before(Honeybadger::Rack::ErrorNotifier, Honeybadger::Rack::UserFeedback)
        end

        config.before_initialize do
          Honeybadger.init!({
            :root           => ::Rails.root.to_s,
            :env            => ::Rails.env,
            :'config.path'  => ::Rails.root.join('config', 'honeybadger.yml'),
            :logger         => Logging::FormattedLogger.new(::Rails.logger),
            :framework      => :rails
          })
        end

        config.after_initialize do
          Honeybadger.load_plugins!
        end
      end
    end
  end
end

Honeybadger.install_at_exit_callback

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
honeybadger-5.8.0 lib/honeybadger/init/rails.rb
honeybadger-5.7.0 lib/honeybadger/init/rails.rb
honeybadger-5.6.0 lib/honeybadger/init/rails.rb
honeybadger-5.5.1 lib/honeybadger/init/rails.rb
honeybadger-5.5.0 lib/honeybadger/init/rails.rb
honeybadger-5.4.1 lib/honeybadger/init/rails.rb
honeybadger-5.4.0 lib/honeybadger/init/rails.rb
honeybadger-5.3.0 lib/honeybadger/init/rails.rb
honeybadger-5.2.1 lib/honeybadger/init/rails.rb
honeybadger-5.0.2 lib/honeybadger/init/rails.rb
honeybadger-5.0.1 lib/honeybadger/init/rails.rb
honeybadger-5.0.0 lib/honeybadger/init/rails.rb
honeybadger-5.0.0.beta1 lib/honeybadger/init/rails.rb