Installs gems for this RequestSet using the Gem::Installeroptions.
If a block is given an activation request and
installer are yielded. The installer will be nil
if a gem matching the request was
already installed.
# File lib/rubygems/request_set.rb, line 146
def install options, &block # :yields: request, installer
if dir = options[:install_dir]
requests = install_into dir, false, options, &block
return requests
end
@prerelease = options[:prerelease]
requests = []
sorted_requests.each do |req|
if req.installed? then
req.spec.spec.build_extensions
if @always_install.none? { |spec| spec == req.spec.spec } then
yield req, nil if block_given?
next
end
end
spec = req.spec.install options do |installer|
yield req, installer if block_given?
end
requests << spec
end
return requests if options[:gemdeps]
specs = requests.map do |request|
case request
when Gem::Resolver::ActivationRequest then
request.spec.spec
else
request
end
end
require 'rubygems/dependency_installer'
inst = Gem::DependencyInstaller.new options
inst.installed_gems.replace specs
Gem.done_installing_hooks.each do |hook|
hook.call inst, specs
end unless Gem.done_installing_hooks.empty?
requests
end