class Chef::Cookbook::FileVendor
Chef::Cookbook::FileVendor¶ ↑
This class handles fetching of cookbook files based on specificity.
Public Class Methods
create_from_manifest(manifest)
click to toggle source
Factory method that creates the appropriate kind of Cookbook::FileVendor to serve the contents of the manifest
# 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)
click to toggle source
# File lib/chef/cookbook/file_vendor.rb, line 27 def self.on_create(&block) @instance_creator = block end
Public Instance Methods
get_filename(filename)
click to toggle source
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.
# File lib/chef/cookbook/file_vendor.rb, line 42 def get_filename(filename) raise NotImplemented, "Subclasses must implement this method" end