Class: Chef::Provider::TemplateFinder
- Defined in:
- lib/chef/provider/template_finder.rb
Instance Method Summary collapse
- #find(template_name, options = {}) ⇒ Object
-
#initialize(run_context, cookbook_name, node) ⇒ TemplateFinder
constructor
A new instance of TemplateFinder.
Constructor Details
#initialize(run_context, cookbook_name, node) ⇒ TemplateFinder
Returns a new instance of TemplateFinder.
24 25 26 27 28 |
# File 'lib/chef/provider/template_finder.rb', line 24 def initialize(run_context, cookbook_name, node) @run_context = run_context @cookbook_name = cookbook_name @node = node end |
Instance Method Details
#find(template_name, options = {}) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/chef/provider/template_finder.rb', line 30 def find(template_name, = {}) template_name = template_source_name(template_name, ) if [:local] return template_name end cookbook_name = find_cookbook_name() cookbook = @run_context.cookbook_collection[cookbook_name] cookbook.preferred_filename_on_disk_location(@node, :templates, template_name) end |