diff options
author | danielsdeleo <dan@opscode.com> | 2012-12-11 14:28:10 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2012-12-11 14:28:10 -0800 |
commit | d4d7de8e7d51677db0cb8adf363bdcccd01e4d0f (patch) | |
tree | d067ab3b22e9c41d6f106f9b60bc86590dc008a1 /lib/chef/node | |
parent | e9c699965a31d5f8cc8d2cba4abced9d725db2b9 (diff) | |
download | chef-d4d7de8e7d51677db0cb8adf363bdcccd01e4d0f.tar.gz |
[CHEF-3680] Specify file and line for eval
Diffstat (limited to 'lib/chef/node')
-rw-r--r-- | lib/chef/node/attribute_collections.rb | 4 | ||||
-rw-r--r-- | lib/chef/node/immutable_collections.rb | 8 |
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, |