Sha256: cbc1c6f05a9dc17a2c45aca5ecc054325ca60c1371c036027baf47adf16b25a5

Contents?: true

Size: 1.27 KB

Versions: 2

Compression:

Stored size: 1.27 KB

Contents

# == 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
  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.respond_to?(:version) && Rails.version =~ /^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 verison 2.0 of Rails we can access the configuration directly.
    # We need it to add dev mode routes after initialization finished.
    config = Rails.configuration if defined?(Rails.configuration)
    NewRelic::Control.instance.init_plugin :config => config
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
newrelic_rpm-2.13.0.beta5 lib/newrelic_rpm.rb
newrelic_rpm-2.13.0.beta4 lib/newrelic_rpm.rb