Class: Chef::Cookbook::FileVendor
- Defined in:
- lib/chef/cookbook/file_vendor.rb
Overview
Chef::Cookbook::FileVendor
This class handles fetching of cookbook files based on specificity.
Direct Known Subclasses
Class Method Summary collapse
-
.create_from_manifest(manifest) ⇒ Object
Factory method that creates the appropriate kind of Cookbook::FileVendor to serve the contents of the manifest.
- .on_create(&block) ⇒ Object
Instance Method Summary collapse
-
#get_filename(filename) ⇒ Object
Gets the on-disk location for the given cookbook file.
Class Method Details
.create_from_manifest(manifest) ⇒ Object
Factory method that creates the appropriate kind of Cookbook::FileVendor to serve the contents of the manifest
33 34 35 36 |
# File 'lib/chef/cookbook/file_vendor.rb', line 33 def self.create_from_manifest(manifest) raise "Must call Chef::Cookbook::FileVendor.on_create before calling create_from_manifest factory" unless defined?(@instance_creator) @instance_creator.call(manifest) end |
.on_create(&block) ⇒ Object
27 28 29 |
# File 'lib/chef/cookbook/file_vendor.rb', line 27 def self.on_create(&block) @instance_creator = block end |
Instance Method Details
#get_filename(filename) ⇒ Object
Gets the on-disk location for the given cookbook file.
Subclasses are responsible for determining exactly how the files are obtained and where they are stored.
42 43 44 |
# File 'lib/chef/cookbook/file_vendor.rb', line 42 def get_filename(filename) raise NotImplemented, "Subclasses must implement this method" end |