In Files

  • rubygems/test_case.rb

Class/Module Index [+]

Quicksearch

Gem::TestCase::StaticSet

The StaticSet is a static set of gem specifications used for testing only. It is available by requiring Gem::TestCase.

Public Class Methods

new(specs) click to toggle source

Creates a new StaticSet for the given specs

 
               # File rubygems/test_case.rb, line 1250
def initialize(specs)
  @specs = specs
end
            

Public Instance Methods

add(spec) click to toggle source

Adds spec to this set.

 
               # File rubygems/test_case.rb, line 1257
def add spec
  @specs << spec
end
            
find_all(dep) click to toggle source

Finds all gems matching dep in this set.

 
               # File rubygems/test_case.rb, line 1273
def find_all(dep)
  @specs.find_all { |s| dep.matches_spec? s }
end
            
find_spec(dep) click to toggle source

Finds dep in this set.

 
               # File rubygems/test_case.rb, line 1264
def find_spec(dep)
  @specs.reverse_each do |s|
    return s if dep.matches_spec? s
  end
end
            
load_spec(name, ver, platform, source) click to toggle source

Loads a Gem::Specification from this set which has the given name, version ver, platform. The source is ignored.

 
               # File rubygems/test_case.rb, line 1281
def load_spec name, ver, platform, source
  dep = Gem::Dependency.new name, ver
  spec = find_spec dep

  Gem::Specification.new spec.name, spec.version do |s|
    s.platform = spec.platform
  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