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



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

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

.to_h(manifest) ⇒ Object Also known as: to_hash



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

def to_h(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