Class: Chef::ChefFS::FileSystem::Repository::CookbooksDir

Inherits:
Directory
  • Object
show all
Defined in:
lib/chef/chef_fs/file_system/repository/cookbooks_dir.rb

Direct Known Subclasses

CookbookArtifactsDir, VersionedCookbooksDir

Instance Attribute Summary

Attributes inherited from Directory

#file_path, #name, #parent, #path

Instance Method Summary collapse

Methods inherited from Directory

#can_have_child?, #child, #children, #create, #create_child, #delete, #dir?, #dir_ls, #empty?, #exists?, #fs_entry_valid?, #initialize, #name_valid?, #path_for_printing, #root

Constructor Details

This class inherits a constructor from Chef::ChefFS::FileSystem::Repository::Directory

Instance Method Details

#chefignoreObject



30
31
32
33
34
# File 'lib/chef/chef_fs/file_system/repository/cookbooks_dir.rb', line 30

def chefignore
  @chefignore ||= Chef::Cookbook::Chefignore.new(file_path)
rescue Errno::EISDIR, Errno::EACCES
  # Work around a bug in Chefignore when chefignore is a directory
end

#write_cookbook(cookbook_path, cookbook_version_json, from_fs) ⇒ Object



36
37
38
39
# File 'lib/chef/chef_fs/file_system/repository/cookbooks_dir.rb', line 36

def write_cookbook(cookbook_path, cookbook_version_json, from_fs)
  cookbook_name = File.basename(cookbook_path)
  make_child_entry(cookbook_name).write(cookbook_path, cookbook_version_json, from_fs)
end