lib/new_relic/control/frameworks/rails.rb in newrelic_rpm-8.2.0 vs lib/new_relic/control/frameworks/rails.rb in newrelic_rpm-8.3.0

- old
+ new

@@ -8,13 +8,12 @@ module Frameworks # Control subclass instantiated when Rails is detected. Contains # Rails specific configuration, instrumentation, environment values, # etc. class Rails < NewRelic::Control::Frameworks::Ruby - def env - @env ||= ( ENV['NEW_RELIC_ENV'] || RAILS_ENV.dup ) + @env ||= (ENV['NEW_RELIC_ENV'] || RAILS_ENV.dup) end # Rails can return an empty string from this method, causing # the agent not to start even when it is properly in a rails 3 # application, so we test the value to make sure it actually @@ -41,11 +40,11 @@ end # In versions of Rails prior to 2.0, the rails config was only available to # the init.rb, so it had to be passed on from there. This is a best effort to # find a config and use that. - def init_config(options={}) + def init_config(options = {}) @config = options[:config] # Install the dependency detection, if rails_config && ::Rails.configuration.respond_to?(:after_initialize) rails_config.after_initialize do # This will insure we load all the instrumentation as late as possible. If the agent @@ -61,12 +60,12 @@ install_browser_monitoring(rails_config) install_agent_hooks(rails_config) end rescue => e ::NewRelic::Agent.logger.error("Failure during init_config for Rails. Is Rails required in a non-Rails app? Set NEW_RELIC_FRAMEWORK=ruby to avoid this message.", - "The Ruby agent will continue running, but Rails-specific features may be missing.", - e) + "The Ruby agent will continue running, but Rails-specific features may be missing.", + e) end def install_agent_hooks(config) return if defined?(@agent_hooks_installed) && @agent_hooks_installed @agent_hooks_installed = true @@ -101,10 +100,10 @@ end protected def rails_vendor_root - File.join(root,'vendor','rails') + File.join(root, 'vendor', 'rails') end def install_shim super require 'new_relic/agent/instrumentation/controller_instrumentation'