class Gem::Resolver::ActivationRequest
Specifies a Specification object that should be activated. Also contains a dependency that was used to introduce this activation.
Attributes
The parent request for this activation request.
The specification to be activated.
Public Class Methods
Creates a new ActivationRequest
that will activate spec
. The parent request
is used to provide diagnostics in case of conflicts.
# File lib/rubygems/resolver/activation_request.rb, line 21 def initialize(spec, request) @spec = spec @request = request end
Public Instance Methods
Is this activation request for a development dependency?
# File lib/rubygems/resolver/activation_request.rb, line 48 def development? @request.development? end
Downloads a gem at path
and returns the file path.
# File lib/rubygems/resolver/activation_request.rb, line 55 def download(path) Gem.ensure_gem_subdirectories path if @spec.respond_to? :sources exception = nil path = @spec.sources.find do |source| begin source.download full_spec, path rescue exception end end return path if path raise exception if exception elsif @spec.respond_to? :source source = @spec.source source.download full_spec, path else source = Gem.sources.first source.download full_spec, path end end
# File lib/rubygems/resolver/activation_request.rb, line 37 def eql?(other) self == other end
The full name of the specification to be activated.
# File lib/rubygems/resolver/activation_request.rb, line 82 def full_name name_tuple.full_name end
The Gem::Specification
for this activation request.
# File lib/rubygems/resolver/activation_request.rb, line 91 def full_spec Gem::Specification === @spec ? @spec : @spec.spec end
# File lib/rubygems/resolver/activation_request.rb, line 41 def hash @spec.hash end
True if the requested gem has already been installed.
# File lib/rubygems/resolver/activation_request.rb, line 104 def installed? case @spec when Gem::Resolver::VendorSpecification then true else this_spec = full_spec Gem::Specification.any? do |s| s == this_spec end end end
The name of this activation request’s specification
# File lib/rubygems/resolver/activation_request.rb, line 120 def name @spec.name end
Return the ActivationRequest
that contained the dependency that we were activated for.
# File lib/rubygems/resolver/activation_request.rb, line 128 def parent @request.requester end
The platform of this activation request’s specification
# File lib/rubygems/resolver/activation_request.rb, line 153 def platform @spec.platform end
The version of this activation request’s specification
# File lib/rubygems/resolver/activation_request.rb, line 146 def version @spec.version end
Private Instance Methods
# File lib/rubygems/resolver/activation_request.rb, line 159 def name_tuple @name_tuple ||= Gem::NameTuple.new(name, version, platform) end