Module: Chef::Sugar::Cookbook

Extended by:
Cookbook
Included in:
Cookbook
Defined in:
lib/chef/sugar/dip/cookbook.rb

Instance Method Summary collapse

Instance Method Details

#file_path(node, cookbook_name, path) ⇒ String

Return path of cookbook file.

Returns:

  • (String)

    path to cookbook file



44
45
46
47
# File 'lib/chef/sugar/dip/cookbook.rb', line 44

def file_path(node, cookbook_name, path)
  object(node, cookbook_name)
    .preferred_filename_on_disk_location(node, :files, path)
end

#files(node, cookbook_name) ⇒ Array

Return array of cookbook files

Returns:

  • (Array)

    the array of cookbook files



30
31
32
# File 'lib/chef/sugar/dip/cookbook.rb', line 30

def files(node, cookbook_name)
  object(node, cookbook_name).send(:file_filenames)
end

#metadata(node, cookbook_name) ⇒ Chef::Cookbook::Metadata

Return Metadata object for current cookbook

Returns:

  • (Chef::Cookbook::Metadata)

    the metadata object of current cookbook



69
70
71
# File 'lib/chef/sugar/dip/cookbook.rb', line 69

def (node, cookbook_name)
  object(node, cookbook_name).
end

#root(node, cookbook_name) ⇒ String

Return absolute root path of cookbook

Returns:

  • (String)

    absolute path to cookbook



81
82
83
# File 'lib/chef/sugar/dip/cookbook.rb', line 81

def root(node, cookbook_name)
  object(node, cookbook_name).send(:root_dir)
end

#templates(node, cookbook_name) ⇒ Array

Return array of cookbook templates

Returns:

  • (Array)

    the array of cookbook templates



57
58
59
# File 'lib/chef/sugar/dip/cookbook.rb', line 57

def templates(node, cookbook_name)
  object(node, cookbook_name).send(:template_filenames)
end