Class: Chef::ChefFS::FileSystem::ChefServer::CookbookArtifactDir

Inherits:
CookbookDir show all
Defined in:
lib/chef/chef_fs/file_system/chef_server/cookbook_artifact_dir.rb

Instance Attribute Summary

Attributes inherited from CookbookDir

#cookbook_name, #version

Attributes inherited from BaseFSObject

#name, #parent, #path

Instance Method Summary collapse

Methods inherited from CookbookDir

#add_child, #api_path, #can_have_child?, #chef_object, #chef_rest, #children, #compare_to, #delete, #dir?, #exists?, #make_child_entry, #rest

Methods inherited from BaseFSDir

#can_have_child?, #dir?, #empty?

Methods inherited from BaseFSObject

#can_have_child?, #chef_object, #child, #children, #compare_to, #create_child, #delete, #dir?, #exists?, #path_for_printing, #read, #root, #write

Constructor Details

#initialize(name, parent, options = {}) ⇒ CookbookArtifactDir

Returns a new instance of CookbookArtifactDir.



26
27
28
29
# File 'lib/chef/chef_fs/file_system/chef_server/cookbook_artifact_dir.rb', line 26

def initialize(name, parent, options = {})
  super(name, parent)
  @cookbook_name, dash, @version = name.rpartition("-")
end

Instance Method Details

#copy_from(other, options = {}) ⇒ Object



31
32
33
# File 'lib/chef/chef_fs/file_system/chef_server/cookbook_artifact_dir.rb', line 31

def copy_from(other, options = {})
  raise OperationNotAllowedError.new(:write, self, nil, "cannot be updated: cookbook artifacts are immutable once uploaded")
end