summaryrefslogtreecommitdiff
path: root/lib/chef/resource_resolver.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-05-13 13:38:41 -0700
committerJohn Keiser <john@johnkeiser.com>2015-05-13 13:43:15 -0700
commit34638bf82798bdcf01c28fbde6ac68dd1949c301 (patch)
treeba58fa54264d520f6d4b9ae201176f5727e462ad /lib/chef/resource_resolver.rb
parentb6336c9de74095cc087463d5c6a3b28aac44e688 (diff)
downloadchef-34638bf82798bdcf01c28fbde6ac68dd1949c301.tar.gz
Add Chef::ResourceResolver.resolvejk/missing_method_missing
Diffstat (limited to 'lib/chef/resource_resolver.rb')
-rw-r--r--lib/chef/resource_resolver.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/chef/resource_resolver.rb b/lib/chef/resource_resolver.rb
index d4151e7125..a987b236c2 100644
--- a/lib/chef/resource_resolver.rb
+++ b/lib/chef/resource_resolver.rb
@@ -51,6 +51,16 @@ class Chef
end.sort {|a,b| a.to_s <=> b.to_s }
end
+ #
+ # Resolve a resource by name.
+ #
+ # @param resource_name [Symbol] The resource DSL name (e.g. `:file`)
+ # @param node [Chef::Node] The node on which the resource will run.
+ #
+ def self.resolve(resource_name, node: Chef.node)
+ new(node, resource_name).resolve
+ end
+
private
# try dynamically finding a resource based on querying the resources to see what they support