Sha256: 2538cfed88ccd16e241a4cbae6bde2c7251f26192c29e9abc30b929ffd880827
Contents?: true
Size: 948 Bytes
Versions: 12
Compression:
Stored size: 948 Bytes
Contents
module RooOnRails module Railties class NewRelic < Rails::Railtie initializer 'roo_on_rails.new_relic' do Rails.logger.with initializer: 'roo_on_rails.new_relic' do |log| log.debug 'loading' license_key = ENV['NEW_RELIC_LICENSE_KEY'] if %w(test development).exclude?(Rails.env.to_s) && (license_key == 'override-me') abort 'Aborting: NEW_RELIC_LICENSE_KEY must be set in production environments' end abort 'Aborting: NEW_RELIC_LICENSE_KEY is required' if license_key.nil? path = %w(newrelic.yml config/newrelic.yml).map do |p| Pathname.new(p) end.find(&:exist?) if path abort "Aborting: newrelic.yml detected in '#{path.parent.realpath}', should not exist" end require 'newrelic_rpm' ::NewRelic::Agent.manual_start unless Rails.env.test? end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems