In Files

  • rubygems/dependency_resolver/activation_request.rb

Class/Module Index [+]

Quicksearch

Gem::DependencyResolver::ActivationRequest

Specifies a Specification object that should be activated. Also contains a dependency that was used to introduce this activation.

Attributes

request[R]
spec[R]

Public Class Methods

new(spec, req, others_possible = true) click to toggle source
 
               # File rubygems/dependency_resolver/activation_request.rb, line 12
def initialize spec, req, others_possible = true
  @spec = spec
  @request = req
  @others_possible = others_possible
end
            

Public Instance Methods

==(other) click to toggle source
 
               # File rubygems/dependency_resolver/activation_request.rb, line 18
def == other
  case other
  when Gem::Specification
    @spec == other
  when Gem::DependencyResolver::ActivationRequest
    @spec == other.spec && @request == other.request
  else
    false
  end
end
            
download(path) click to toggle source
 
               # File rubygems/dependency_resolver/activation_request.rb, line 29
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() click to toggle source
 
               # File rubygems/dependency_resolver/activation_request.rb, line 41
def full_name
  @spec.full_name
end
            
full_spec() click to toggle source
 
               # File rubygems/dependency_resolver/activation_request.rb, line 45
def full_spec
  Gem::Specification === @spec ? @spec : @spec.spec
end
            
installed?() click to toggle source

Indicates if the requested gem has already been installed.

 
               # File rubygems/dependency_resolver/activation_request.rb, line 61
def installed?
  this_spec = full_spec

  Gem::Specification.any? do |s|
    s == this_spec
  end
end
            
name() click to toggle source
 
               # File rubygems/dependency_resolver/activation_request.rb, line 69
def name
  @spec.name
end
            
others_possible?() click to toggle source

Indicate if this activation is one of a set of possible requests for the same Dependency request.

 
               # File rubygems/dependency_resolver/activation_request.rb, line 77
def others_possible?
  @others_possible
end
            
parent() click to toggle source

Return the ActivationRequest that contained the dependency that we were activated for.

 
               # File rubygems/dependency_resolver/activation_request.rb, line 85
def parent
  @request.requester
end
            
version() click to toggle source
 
               # File rubygems/dependency_resolver/activation_request.rb, line 104
def version
  @spec.version
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please see Improve the docs, or visit Documenting-ruby.org.

blog comments powered by Disqus