summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-06-26 14:10:55 -0600
committerJohn Keiser <john@johnkeiser.com>2015-06-30 11:18:41 -0600
commit079f5794af116acb4a32124684fc8965b5ba53ee (patch)
treea8c012c0d9718b6273390af8a8ecf86133bcc4a1 /lib/chef/resource.rb
parentf0e9b2ffe7ec0904456b50ee26913cb42c0ca258 (diff)
downloadchef-079f5794af116acb4a32124684fc8965b5ba53ee.tar.gz
Call provides? when resolving, reduce number of calls to provides?
in Provider
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r--lib/chef/resource.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 704490e748..9510351d16 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -1297,7 +1297,7 @@ class Chef
end
def self.inherited(child)
super
- @sorted_descendants = nil
+ @@sorted_descendants = nil
# set resource_name automatically if it's not set
if child.name && !child.resource_name
if child.name =~ /^Chef::Resource::(\w+)$/
@@ -1340,8 +1340,8 @@ class Chef
result
end
- def self.provides?(node, resource)
- Chef::ResourceResolver.resolve(resource, node: node).provided_by?(self)
+ def self.provides?(node, resource_name)
+ Chef::ResourceResolver.new(node, resource_name).provided_by?(self)
end
# Helper for #notifies