summaryrefslogtreecommitdiff
path: root/lib/chef/node
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/node')
-rw-r--r--lib/chef/node/attribute_collections.rb4
-rw-r--r--lib/chef/node/immutable_collections.rb8
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/node/attribute_collections.rb b/lib/chef/node/attribute_collections.rb
index 521687e8df..5f4728b400 100644
--- a/lib/chef/node/attribute_collections.rb
+++ b/lib/chef/node/attribute_collections.rb
@@ -61,7 +61,7 @@ class Chef
# also invalidate the cached merged_attributes on the root
# Node::Attribute object.
MUTATOR_METHODS.each do |mutator|
- class_eval(<<-METHOD_DEFN)
+ class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
def #{mutator}(*args, &block)
root.reset_cache
super
@@ -115,7 +115,7 @@ class Chef
# also invalidate the cached `merged_attributes` on the root Attribute
# object.
MUTATOR_METHODS.each do |mutator|
- class_eval(<<-METHOD_DEFN)
+ class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
def #{mutator}(*args, &block)
root.reset_cache
super
diff --git a/lib/chef/node/immutable_collections.rb b/lib/chef/node/immutable_collections.rb
index 33f722cd4a..25a653ef74 100644
--- a/lib/chef/node/immutable_collections.rb
+++ b/lib/chef/node/immutable_collections.rb
@@ -173,7 +173,7 @@ class Chef
# This is the magic that makes this object "Immutable"
DISALLOWED_MUTATOR_METHODS.each do |mutator_method_name|
# Ruby 1.8 blocks can't have block arguments, so we must use string eval:
- class_eval(<<-METHOD_DEFN)
+ class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
def #{mutator_method_name}(*args, &block)
msg = "Node attributes are read-only when you do not specify which precedence level to set. " +
%Q(To set an attribute use code like `node.default["key"] = "value"')
@@ -183,7 +183,7 @@ class Chef
end
READER_METHODS.each do |reader|
- class_eval(<<-METHOD_DEFN)
+ class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
def #{reader}(*args, &block)
if root.stale_subtree?(@serial_number)
raise Exceptions::StaleAttributeRead,
@@ -330,7 +330,7 @@ class Chef
# This is the magic that makes this object "Immutable"
DISALLOWED_MUTATOR_METHODS.each do |mutator_method_name|
# Ruby 1.8 blocks can't have block arguments, so we must use string eval:
- class_eval(<<-METHOD_DEFN)
+ class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
def #{mutator_method_name}(*args, &block)
msg = "Node attributes are read-only when you do not specify which precedence level to set. " +
%Q(To set an attribute use code like `node.default["key"] = "value"')
@@ -340,7 +340,7 @@ class Chef
end
READER_METHODS.each do |reader_method|
- class_eval(<<-METHOD_DEFN)
+ class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
def #{reader_method}(*args, &block)
if root.stale_subtree?(@serial_number)
raise Exceptions::StaleAttributeRead,