Sha256: ab5323820396558b44237d4cbf83dfc54cb1a130a9ca71dfbcb0e1c9b5cc3d67

Contents?: true

Size: 1.33 KB

Versions: 50

Compression:

Stored size: 1.33 KB

Contents

module NewRelic
  class Control
    module Frameworks
      # A control used when no framework is detected - the default.
      # 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.
      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

50 entries across 50 versions & 4 rubygems

Version Path
dolores_rpm-3.2.0.4 lib/new_relic/control/frameworks/ruby.rb
dolores_rpm-3.2.0.3 lib/new_relic/control/frameworks/ruby.rb
dolores_rpm-3.2.0.2 lib/new_relic/control/frameworks/ruby.rb
dolores_rpm-3.3.4.fork lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.4.1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.4 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.4.beta1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.3 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.3.beta2 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.2.1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.3.beta1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.2 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.2.beta2 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.2.beta1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.1.beta2 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.1.beta1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.0 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.3.0.beta1 lib/new_relic/control/frameworks/ruby.rb
newrelic_rpm-3.2.0.1 lib/new_relic/control/frameworks/ruby.rb