class Gem::TestCase::StaticSet
The StaticSet
is a static set of gem specifications used for testing only. It is available by requiring Gem::TestCase
.
Attributes
remote[RW]
A StaticSet
ignores remote because it has a fixed set of gems.
Public Class Methods
new(specs)
click to toggle source
Creates a new StaticSet
for the given specs
Calls superclass method
BasicObject::new
# File lib/rubygems/test_case.rb, line 1481 def initialize(specs) super() @specs = specs @remote = true end
Public Instance Methods
add(spec)
click to toggle source
Adds spec
to this set.
# File lib/rubygems/test_case.rb, line 1492 def add(spec) @specs << spec end
find_all(dep)
click to toggle source
Finds all gems matching dep
in this set.
# File lib/rubygems/test_case.rb, line 1508 def find_all(dep) @specs.find_all { |s| dep.match? s, @prerelease } end
find_spec(dep)
click to toggle source
Finds dep
in this set.
# File lib/rubygems/test_case.rb, line 1499 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 lib/rubygems/test_case.rb, line 1516 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