Sha256: f464ef526095e3ed8b9ddd867285ae2f128877f362ea577aea29588ee1486d2c

Contents?: true

Size: 1.25 KB

Versions: 10

Compression:

Stored size: 1.25 KB

Contents

require "raygun/middleware/rails_insert_affected_user"

class Raygun::Railtie < Rails::Railtie
  initializer "raygun.configure_rails_initialization" do |app|

    # Thanks Airbrake: See https://github.com/rails/rails/pull/8624
    middleware = if defined?(ActionDispatch::DebugExceptions)
                   if Rails::VERSION::STRING >= "5"
                     ActionDispatch::DebugExceptions
                   else
                     # Rails >= 3.2.0
                     "ActionDispatch::DebugExceptions"
                   end
                 else
                   # Rails < 3.2.0
                   "ActionDispatch::ShowExceptions"
                 end

    raygun_middleware = [
      Raygun::Middleware::RailsInsertAffectedUser,
      Raygun::Middleware::RackExceptionInterceptor,
      Raygun::Middleware::BreadcrumbsStoreInitializer
    ]
    raygun_middleware = raygun_middleware.map(&:to_s) unless Rails::VERSION::STRING >= "5"
    raygun_middleware.each do |m|
      app.config.middleware.insert_after(middleware, m)
    end
  end

  config.to_prepare do
    Raygun.default_configuration.logger           = Rails.logger
    Raygun.default_configuration.enable_reporting = Rails.env.production?
  end

  rake_tasks do
    load "tasks/raygun.tasks"
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
raygun4ruby-3.0.0 lib/raygun/railtie.rb
raygun4ruby-2.7.1 lib/raygun/railtie.rb
raygun4ruby-2.7.0 lib/raygun/railtie.rb
raygun4ruby-2.6.0 lib/raygun/railtie.rb
raygun4ruby-2.5.0 lib/raygun/railtie.rb
raygun4ruby-2.4.1 lib/raygun/railtie.rb
raygun4ruby-2.4.0 lib/raygun/railtie.rb
raygun4ruby-2.3.0 lib/raygun/railtie.rb
raygun4ruby-2.2.0 lib/raygun/railtie.rb
raygun4ruby-2.1.0 lib/raygun/railtie.rb