Class: Chef::ChefFS::FileSystem::ChefServer::VersionedCookbookDir

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

Constant Summary collapse

VALID_VERSIONED_COOKBOOK_NAME =
/^([.a-zA-Z0-9_-]+)-(\d+\.\d+\.\d+)$/.freeze

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, #copy_from, #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 = {}) ⇒ VersionedCookbookDir

Returns a new instance of VersionedCookbookDir.



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/chef/chef_fs/file_system/chef_server/versioned_cookbook_dir.rb', line 30

def initialize(name, parent, options = {})
  super(name, parent)
  # If the name is apache2-1.0.0 and versioned_cookbooks is on, we know
  # the actual cookbook_name and version.
  if name =~ VALID_VERSIONED_COOKBOOK_NAME
    @cookbook_name = $1
    @version = $2
  else
    @exists = false
  end
end