Sha256: b7b64cedfdd9edabe76bbe85c30557c05f92ce9132f2221b87718c06de957a56

Contents?: true

Size: 1.3 KB

Versions: 21

Compression:

Stored size: 1.3 KB

Contents

require 'ftools'
require 'erb'

# Install a newrelic.yml file into the local config directory.
# If no such directory exists, install it in ~/.newrelic.
#
# If a config file already exists, print a warning and exit.
#
if File.directory? "config"
  dest_dir = "config"
else
  dest_dir = File.join(ENV["HOME"],".newrelic") rescue nil
  FileUtils.mkdir(dest_dir) if dest_dir
end

src_config_file = File.join(File.dirname(__FILE__),"newrelic.yml")
dest_config_file = File.join(dest_dir, "newrelic.yml") if dest_dir

if !dest_dir
  STDERR.puts "Could not find a config or ~/.newrelic directory to locate the default newrelic.yml file"
elsif File::exists? dest_config_file
  STDERR.puts "\nA config file already exists at #{dest_config_file}.\n"
else
  generated_for_user = ""
  license_key = "PASTE_YOUR_KEY_HERE"
  yaml = ERB.new(File.read(src_config_file)).result(binding)
  File.open( dest_config_file, 'w' ) do |out|
    out.puts yaml
  end
  
  puts IO.read(File.join(File.dirname(__FILE__), 'README'))
  puts "\n--------------------------------------------------------\n"
  puts "Installing a default configuration file in #{dest_dir}."
  puts "To monitor your application in production mode, you must enter a license key."
  puts "See #{dest_config_file}"
  puts "For a license key, sign up at http://rpm.newrelic.com/signup."
end  

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
makevoid-newrelic_rpm-2.8.999 install.rb
newrelic_rpm-2.9.9 install.rb
newrelic_rpm-2.9.8 install.rb
newrelic_rpm-2.9.6 install.rb
genki-newrelic_rpm-2.10.1 install.rb
newrelic_rpm-2.9.5 install.rb
newrelic_rpm-2.9.2 install.rb
newrelic_rpm-2.9.3 install.rb
newrelic_rpm-2.9.4 install.rb
newrelic_rpm-2.8.4 install.rb
newrelic_rpm-2.8.5 install.rb
newrelic_rpm-2.8.6 install.rb
newrelic_rpm-2.8.0 install.rb
newrelic_rpm-2.8.7 install.rb
newrelic_rpm-2.8.1 install.rb
newrelic_rpm-2.8.10 install.rb
newrelic_rpm-2.8.11 install.rb
newrelic_rpm-2.8.2 install.rb
newrelic_rpm-2.8.3 install.rb
newrelic_rpm-2.8.9 install.rb