Sha256: 5d1d483b8912c018bdea193f77b7d05161358ee0c36cc3a0776a8ab9c56f47c2

Contents?: true

Size: 1.29 KB

Versions: 16

Compression:

Stored size: 1.29 KB

Contents

# A control used when no framework is detected.
# Looks for a newrelic.yml file in several locations
# including ./, ./config, $HOME/.newrelic and $HOME/.
# It loads the settings from the newrelic.yml section
# based on the value of RUBY_ENV or RAILS_ENV.
module NewRelic
  class Control
    module Frameworks
      class Ruby < NewRelic::Control

        def env
          @env ||= ENV['RUBY_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
        end
        def root
          @root ||= ENV['APP_ROOT'] || Dir['.']
        end
        # Check a sequence of file locations for newrelic.yml
        def config_file
          files = []
          files << File.join(root,"config","newrelic.yml")
          files << File.join(root,"newrelic.yml")
          if ENV["HOME"]
            files << File.join(ENV["HOME"], ".newrelic", "newrelic.yml")
            files << File.join(ENV["HOME"], "newrelic.yml")
          end
          files << File.expand_path(ENV["NRCONFIG"]) if ENV["NRCONFIG"]
          files.each do | file |
            return File.expand_path(file) if File.exists? file
          end
          return File.expand_path(files.first)
        end
        def to_stdout(msg)
          STDOUT.puts msg
        end

        def init_config(options={})
        end

      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
ghazel-newrelic_rpm-3.1.0.1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.1.0 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.1.0.beta5 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.1.0.beta4 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.1.0.djlogging2 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.1.0.djlogging lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.1.0.beta3 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.1.0.beta2 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.0.1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.1.0.beta1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.0.0 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.0.0.beta2 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.0.0.beta1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-2.14.1.logging1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-2.14.1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-2.14.0 lib/new_relic/control/frameworks/ruby.rb