Class: Chef::Cookbook::ManifestV2

Inherits:
Object
  • Object
show all
Extended by:
Mixin::VersionedAPI
Defined in:
lib/chef/cookbook/manifest_v2.rb

Class Method Summary collapse

Methods included from Mixin::VersionedAPI

minimum_api_version

Class Method Details

.from_hash(hash) ⇒ Object


26
27
28
29
# File 'lib/chef/cookbook/manifest_v2.rb', line 26

def self.from_hash(hash)
  Chef::Log.debug "processing manifest: #{hash}"
  Mash.new hash
end

.to_hash(manifest) ⇒ Object


31
32
33
34
35
36
37
# File 'lib/chef/cookbook/manifest_v2.rb', line 31

def self.to_hash(manifest)
  result = manifest.manifest.dup
  result["all_files"].map! { |file| file.delete("full_path"); file }
  result["frozen?"] = manifest.frozen_version?
  result["chef_type"] = "cookbook_version"
  result.to_hash
end