Sha256: 392f8325e4dc240491fb3e298c8f23bb7bc6f73d61f24ae3f1eb0155236c7928

Contents?: true

Size: 1.5 KB

Versions: 22

Compression:

Stored size: 1.5 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

# == New Relic Initialization
#
# When installed as a gem, you can activate the New Relic agent one of the following ways:
#
# For Rails, add:
#    config.gem 'newrelic_rpm'
# to your initialization sequence.
#
# For merb, do
#    dependency 'newrelic_rpm'
# in the Merb config/init.rb
#
# For Sinatra, do
#    require 'newrelic_rpm'
# after requiring 'sinatra'.
#
# For other frameworks, or to manage the agent manually, invoke NewRelic::Agent#manual_start
# directly.
#
require 'new_relic/control'
if defined?(Merb) && defined?(Merb::BootLoader)
  module NewRelic
    class MerbBootLoader < Merb::BootLoader
      after Merb::BootLoader::ChooseAdapter
      def self.run
        NewRelic::Control.instance.init_plugin
      end
    end
  end
elsif defined? Rails
  if Rails::VERSION::MAJOR.to_i >= 3
    module NewRelic
      class Railtie < Rails::Railtie

        initializer "newrelic_rpm.start_plugin" do |app|
          NewRelic::Control.instance.init_plugin(:config => app.config)
        end
      end
    end
  else
    # After version 2.0 of Rails we can access the configuration directly.
    # We need it to add dev mode routes after initialization finished.
    config = nil
    config = Rails.configuration if Rails.respond_to?(:configuration)
    NewRelic::Control.instance.init_plugin :config => config
  end
else
  NewRelic::Control.instance.init_plugin
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
newrelic_rpm-3.7.0.174.beta lib/newrelic_rpm.rb
newrelic_rpm-3.6.9.171 lib/newrelic_rpm.rb
newrelic_rpm-3.6.8.168 lib/newrelic_rpm.rb
newrelic_rpm-3.6.8.164 lib/newrelic_rpm.rb
newrelic_rpm-3.6.7.159 lib/newrelic_rpm.rb
newrelic_rpm-3.6.7.159.beta lib/newrelic_rpm.rb
newrelic_rpm-3.6.7.152 lib/newrelic_rpm.rb
newrelic_rpm-3.6.6.147 lib/newrelic_rpm.rb
newrelic_rpm-3.6.5.130 lib/newrelic_rpm.rb
newrelic_rpm-3.6.4.122 lib/newrelic_rpm.rb
newrelic_rpm-3.6.4.113.beta lib/newrelic_rpm.rb
newrelic_rpm-3.6.3.111 lib/newrelic_rpm.rb
newrelic_rpm-3.6.3.106 lib/newrelic_rpm.rb
newrelic_rpm-3.6.3.105.beta lib/newrelic_rpm.rb
newrelic_rpm-3.6.3.104 lib/newrelic_rpm.rb
newrelic_rpm-3.6.3.103.beta lib/newrelic_rpm.rb
newrelic_rpm-3.6.2.96 lib/newrelic_rpm.rb
newrelic_rpm-3.6.2.90.beta lib/newrelic_rpm.rb
newrelic_rpm-3.6.1.88 lib/newrelic_rpm.rb
newrelic_rpm-3.6.1.87 lib/newrelic_rpm.rb