Method: Berkshelf::CachedCookbook.from_path

Defined in:
lib/berkshelf/cached_cookbook.rb

.from_path(path) ⇒ Ridley::Chef::Cookbook

Creates a new instance of Berkshelf::CachedCookbook from a path on disk containing a Cookbook.

The name of the Cookbook is determined by the value of the name attribute set in the cookbooks’ metadata. If the name attribute is not present the name of the loaded cookbook is determined by directory containing the cookbook.

Parameters:

  • path (#to_s)

    a path on disk to the location of a Cookbook

Returns:

  • (Ridley::Chef::Cookbook)

Raises:

  • (IOError)

    if the path does not contain a metadata.rb or metadata.json file



36
37
38
39
40
# File 'lib/berkshelf/cached_cookbook.rb', line 36

def from_path(path)
  path = Pathname.new(path)

  new(path)
end