Class: CookbookOmnifetch::MetadataBasedInstaller::CookbookMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/cookbook-omnifetch/metadata_based_installer.rb

Constant Summary collapse

FILE_TYPES =
%i{
  resources
  providers
  recipes
  definitions
  libraries
  attributes
  files
  templates
  root_files
  all_files
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(metadata) ⇒ CookbookMetadata

Returns a new instance of CookbookMetadata.



23
24
25
# File 'lib/cookbook-omnifetch/metadata_based_installer.rb', line 23

def initialize()
  @metadata = 
end

Instance Method Details

#files(&block) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/cookbook-omnifetch/metadata_based_installer.rb', line 27

def files(&block)
  FILE_TYPES.each do |type|
    next unless @metadata.key?(type.to_s)

    @metadata[type.to_s].each do |file|
      yield file["url"], file["path"], file["checksum"]
    end
  end
end