Class: Gem::DependencyResolver::ActivationRequest
- Inherits:
-
Object
- Object
- Gem::DependencyResolver::ActivationRequest
- Defined in:
- lib/rubygems/dependency_resolver.rb
Overview
Specifies a Specification object that should be activated. Also contains a dependency that was used to introduce this activation.
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #download(path) ⇒ Object
- #full_name ⇒ Object
- #full_spec ⇒ Object
-
#initialize(spec, req, others_possible = true) ⇒ ActivationRequest
constructor
A new instance of ActivationRequest.
-
#installed? ⇒ Boolean
Indicates if the requested gem has already been installed.
- #name ⇒ Object
-
#others_possible? ⇒ Boolean
Indicate if this activation is one of a set of possible requests for the same Dependency request.
-
#parent ⇒ Object
Return the ActivationRequest that contained the dependency that we were activated for.
- #version ⇒ Object
Constructor Details
#initialize(spec, req, others_possible = true) ⇒ ActivationRequest
Returns a new instance of ActivationRequest.
364 365 366 367 368 |
# File 'lib/rubygems/dependency_resolver.rb', line 364 def initialize(spec, req, others_possible=true) @spec = spec @request = req @others_possible = others_possible end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
370 371 372 |
# File 'lib/rubygems/dependency_resolver.rb', line 370 def request @request end |
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
370 371 372 |
# File 'lib/rubygems/dependency_resolver.rb', line 370 def spec @spec end |
Instance Method Details
#==(other) ⇒ Object
414 415 416 417 418 419 420 421 422 423 |
# File 'lib/rubygems/dependency_resolver.rb', line 414 def ==(other) case other when Gem::Specification @spec == other when ActivationRequest @spec == other.spec && @request == other.request else false end end |
#download(path) ⇒ Object
402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/rubygems/dependency_resolver.rb', line 402 def download(path) if @spec.respond_to? :source source = @spec.source else source = Gem.sources.first end Gem.ensure_gem_subdirectories path source.download full_spec, path end |
#full_name ⇒ Object
390 391 392 |
# File 'lib/rubygems/dependency_resolver.rb', line 390 def full_name @spec.full_name end |
#full_spec ⇒ Object
398 399 400 |
# File 'lib/rubygems/dependency_resolver.rb', line 398 def full_spec Gem::Specification === @spec ? @spec : @spec.spec end |
#installed? ⇒ Boolean
Indicates if the requested gem has already been installed.
428 429 430 431 432 433 434 |
# File 'lib/rubygems/dependency_resolver.rb', line 428 def installed? this_spec = full_spec Gem::Specification.any? do |s| s == this_spec end end |
#name ⇒ Object
386 387 388 |
# File 'lib/rubygems/dependency_resolver.rb', line 386 def name @spec.name end |
#others_possible? ⇒ Boolean
Indicate if this activation is one of a set of possible requests for the same Dependency request.
375 376 377 |
# File 'lib/rubygems/dependency_resolver.rb', line 375 def others_possible? @others_possible end |
#parent ⇒ Object
Return the ActivationRequest that contained the dependency that we were activated for.
382 383 384 |
# File 'lib/rubygems/dependency_resolver.rb', line 382 def parent @request.requester end |
#version ⇒ Object
394 395 396 |
# File 'lib/rubygems/dependency_resolver.rb', line 394 def version @spec.version end |