Sha256: fa6c8a1a0c50386a23efe8f9a517dda5f64a9b3a28edc75816798480e14287c8

Contents?: true

Size: 826 Bytes

Versions: 22

Compression:

Stored size: 826 Bytes

Contents

if defined?(::Rails)
  Appsignal.logger.info('Loading Rails integration')

  module Appsignal
    module Integrations
      class Railtie < ::Rails::Railtie
        initializer 'appsignal.configure_rails_initialization' do |app|
          app.middleware.insert_before(
            ActionDispatch::RemoteIp,
            Appsignal::Rack::Listener
          )
        end

        config.after_initialize do
          # Start logger
          Appsignal.start_logger(Rails.root.join('log'))

          # Load config
          Appsignal.config = Appsignal::Config.new(
            Rails.root,
            Rails.env,
            :name => Rails.application.class.parent_name
          )

          # Start agent if config for this env is present
          Appsignal.start if Appsignal.active?
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
appsignal-0.9.2 lib/appsignal/integrations/rails.rb
appsignal-0.9.1 lib/appsignal/integrations/rails.rb
appsignal-0.9.0 lib/appsignal/integrations/rails.rb
appsignal-0.8.15 lib/appsignal/integrations/rails.rb
appsignal-0.9.0.beta.1 lib/appsignal/integrations/rails.rb
appsignal-0.9.0.alpha.1 lib/appsignal/integrations/rails.rb
appsignal-0.8.14 lib/appsignal/integrations/rails.rb
appsignal-0.8.13 lib/appsignal/integrations/rails.rb
appsignal-0.8.12 lib/appsignal/integrations/rails.rb
appsignal-0.8.11 lib/appsignal/integrations/rails.rb
appsignal-0.8.10 lib/appsignal/integrations/rails.rb
appsignal-0.8.8 lib/appsignal/integrations/rails.rb
appsignal-0.8.7 lib/appsignal/integrations/rails.rb
appsignal-0.8.7.alpha.1 lib/appsignal/integrations/rails.rb
appsignal-0.8.6 lib/appsignal/integrations/rails.rb
appsignal-0.8.6.beta.1 lib/appsignal/integrations/rails.rb
appsignal-0.8.6.beta.0 lib/appsignal/integrations/rails.rb
appsignal-0.8.5 lib/appsignal/integrations/rails.rb
appsignal-0.8.4 lib/appsignal/integrations/rails.rb
appsignal-0.8.4.beta.1 lib/appsignal/integrations/rails.rb