lib/new_relic/agent/configuration/manager.rb in newrelic_rpm-3.6.5.130 vs lib/new_relic/agent/configuration/manager.rb in newrelic_rpm-3.6.6.147
- old
+ new
@@ -16,12 +16,11 @@
extend Forwardable
def_delegators :@cache, :[], :has_key?
attr_reader :config_stack, :stripped_exceptions_whitelist
def initialize
- @config_stack = [ EnvironmentSource.new, DEFAULTS ]
- @cache = Hash.new {|hash,key| hash[key] = self.fetch(key) }
+ reset_to_defaults
@callbacks = Hash.new {|hash,key| hash[key] = [] }
register_callback(:'strip_exception_messages.whitelist') do |whitelist|
if whitelist
@stripped_exceptions_whitelist = parse_constant_list(whitelist).compact
@@ -141,9 +140,15 @@
case self[:app_name]
when Array then self[:app_name]
when String then self[:app_name].split(';')
else []
end
+ end
+
+ # Generally only useful during initial construction and tests
+ def reset_to_defaults
+ @config_stack = [ EnvironmentSource.new, DEFAULTS ]
+ reset_cache
end
def reset_cache
@cache = Hash.new {|hash,key| hash[key] = self.fetch(key) }
end