Sha256: 8209f1ca170930f7ecca41171b49459b4a95b3c3c1db982ca8e75c1a31380877

Contents?: true

Size: 1.08 KB

Versions: 20

Compression:

Stored size: 1.08 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. 
class NewRelic::Control::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

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
onyx_newrelic_rpm-2.12.5 lib/new_relic/control/ruby.rb
newrelic_rpm-2.12.3 lib/new_relic/control/ruby.rb
newrelic_rpm-2.12.2 lib/new_relic/control/ruby.rb
newrelic_rpm-2.12.2.beta2 lib/new_relic/control/ruby.rb
newrelic_rpm-2.12.2.beta lib/new_relic/control/ruby.rb
newrelic_rpm-2.12.1 lib/new_relic/control/ruby.rb
newrelic_rpm-2.12.1.alpha lib/new_relic/control/ruby.rb
newrelic_rpm-2.12.0 lib/new_relic/control/ruby.rb
newrelic_rpm-2.11.3 lib/new_relic/control/ruby.rb
newrelic_rpm-2.11.2 lib/new_relic/control/ruby.rb
newrelic_rpm-2.11.2.beta2 lib/new_relic/control/ruby.rb
newrelic_rpm-2.11.2.beta lib/new_relic/control/ruby.rb
newrelic_rpm-2.11.1 lib/new_relic/control/ruby.rb
newrelic_rpm-2.11.0.beta2 lib/new_relic/control/ruby.rb
newrelic_rpm-2.11.0.beta lib/new_relic/control/ruby.rb
newrelic_rpm-2.10.8 lib/new_relic/control/ruby.rb
newrelic_rpm-2.10.6 lib/new_relic/control/ruby.rb
newrelic_rpm-2.10.5 lib/new_relic/control/ruby.rb
newrelic_rpm-2.10.4 lib/new_relic/control/ruby.rb
newrelic_rpm-2.10.3 lib/new_relic/control/ruby.rb