# File lib/new_relic/agent/configuration/yaml_source.rb, line 78 def process_erb(file) begin # Exclude lines that are commented out so failing Ruby code in an # ERB template commented at the YML level is fine. Leave the line, # though, so ERB line numbers remain correct. file.gsub!(/^\s*#.*$/, '#') # Next two are for populating the newrelic.yml via erb binding, necessary # when using the default newrelic.yml file generated_for_user = '' license_key = '' ERB.new(file).result(binding) rescue ScriptError, StandardError => e log_failure("Failed ERB processing configuration file. This is typically caused by a Ruby error in <% %> templating blocks in your newrelic.yml file.", e) nil ensure # Avoid warnings by using these again generated_for_user = nil license_key = nil end end