In Files

  • rubygems/resolver/lock_specification.rb

Class/Module Index [+]

Quicksearch

Gem::Resolver::LockSpecification

The LockSpecification comes from a lockfile (Gem::RequestSet::Lockfile).

A LockSpecification’s dependency information is pre-filled from the lockfile.

Public Class Methods

new(set, name, version, source, platform) click to toggle source
 
               # File rubygems/resolver/lock_specification.rb, line 9
def initialize set, name, version, source, platform
  super()

  @name     = name
  @platform = platform
  @set      = set
  @source   = source
  @version  = version

  @dependencies = []
  @spec         = nil
end
            

Public Instance Methods

install(options) click to toggle source

This is a null install as a locked specification is considered installed. options are ignored.

 
               # File rubygems/resolver/lock_specification.rb, line 26
def install options
  destination = options[:install_dir] || Gem.dir

  if File.exist? File.join(destination, 'specifications', spec.spec_name) then
    yield nil
    return
  end

  super
end
            
spec() click to toggle source

A specification constructed from the lockfile is returned

 
               # File rubygems/resolver/lock_specification.rb, line 47
def spec
  @spec ||= Gem::Specification.new do |s|
    s.name     = @name
    s.version  = @version
    s.platform = @platform

    s.dependencies.concat @dependencies
  end
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 visit Documenting-ruby.org.

blog comments powered by Disqus