Sha256: d40688e4673e214fa9af8ad454ebf6a8bf0ad4fd3b4469cf738df1937a5729fe

Contents?: true

Size: 1.51 KB

Versions: 45

Compression:

Stored size: 1.51 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::VERSION)
  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

45 entries across 45 versions & 2 rubygems

Version Path
newrelic_rpm-4.7.1.340 lib/newrelic_rpm.rb
newrelic_rpm-4.7.0.339 lib/newrelic_rpm.rb
newrelic_rpm-4.6.0.338 lib/newrelic_rpm.rb
newrelic_rpm-4.5.0.337 lib/newrelic_rpm.rb
newrelic_rpm-4.4.0.336 lib/newrelic_rpm.rb
newrelic_rpm-4.3.0.335 lib/newrelic_rpm.rb
newrelic_rpm-4.2.0.334 lib/newrelic_rpm.rb
newrelic_rpm-4.1.0.333 lib/newrelic_rpm.rb
newrelic_rpm-4.0.0.332 lib/newrelic_rpm.rb
newrelic_rpm-3.18.1.330 lib/newrelic_rpm.rb
newrelic_rpm-3.18.0.329 lib/newrelic_rpm.rb
newrelic_rpm-3.17.2.327 lib/newrelic_rpm.rb
newrelic_rpm-3.17.1.326 lib/newrelic_rpm.rb
newrelic_rpm-3.17.0.325 lib/newrelic_rpm.rb
newrelic_rpm-3.16.3.323 lib/newrelic_rpm.rb
newrelic_rpm-3.16.2.321 lib/newrelic_rpm.rb
newrelic_rpm-3.16.1.320 lib/newrelic_rpm.rb
newrelic_rpm-3.16.0.318 lib/newrelic_rpm.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.2.317/lib/newrelic_rpm.rb
newrelic_rpm-3.15.2.317 lib/newrelic_rpm.rb