Class: Chef::Cookbook::GemInstaller

Inherits:
Object
  • Object
show all
Defined in:
lib/chefspec/extensions/chef/cookbook/gem_installer.rb

Instance Method Summary collapse

Instance Method Details

#installObject

Installs the gems into the omnibus gemset.


7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/chefspec/extensions/chef/cookbook/gem_installer.rb', line 7

def install
  cookbook_gems = Hash.new { |h, k| h[k] = [] }

  cookbook_collection.each do |cookbook_name, cookbook_version|
    cookbook_version..gems.each do |args|
      cookbook_gems[args.first] += args[1..-1]
    end
  end

  events.cookbook_gem_start(cookbook_gems)
  cookbook_gems.each { |gem_name, gem_requirements| locate_gem(gem_name, gem_requirements) }
  events.cookbook_gem_finished
end