Sha256: 35254ae87d10989f65bc1dab25f9b5df52b336dd171cd3b35a16b35a58e9f29d
Contents?: true
Size: 883 Bytes
Versions: 2
Compression:
Stored size: 883 Bytes
Contents
require 'chef/mixin/descendants_tracker' class Chef module Mixin module Provides include Chef::Mixin::DescendantsTracker def node_map @node_map ||= Chef::NodeMap.new end def provides(short_name, opts={}, &block) if !short_name.kind_of?(Symbol) # YAGNI: this is probably completely unnecessary and can be removed? Chef::Log.deprecation "Passing a non-Symbol to Chef::Resource#provides will be removed" if short_name.kind_of?(String) short_name.downcase! short_name.gsub!(/\s/, "_") end short_name = short_name.to_sym end node_map.set(short_name, true, opts, &block) end # provides a node on the resource (early binding) def provides?(node, resource_name) node_map.get(node, resource_name) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
chef-12.3.0.rc.0-x86-mingw32 | lib/chef/mixin/provides.rb |
chef-12.3.0.rc.0 | lib/chef/mixin/provides.rb |