Class
The StaticSet
is a static set of gem specifications used for testing only. It is available by requiring Gem::TestCase
.
Attributes
Class Methods
::
lib/rubygems/test_case.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rubygems/test_case.rb, line 1368
def initialize(specs)
super()
@specs = specs
@remote = true
end
Creates a new StaticSet
for the given specs
Instance Methods
lib/rubygems/test_case.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rubygems/test_case.rb, line 1379
def add spec
@specs << spec
end
Adds spec
to this set.
lib/rubygems/test_case.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rubygems/test_case.rb, line 1395
def find_all(dep)
@specs.find_all { |s| dep.match? s, @prerelease }
end
Finds all gems matching dep
in this set.
lib/rubygems/test_case.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rubygems/test_case.rb, line 1386
def find_spec(dep)
@specs.reverse_each do |s|
return s if dep.matches_spec? s
end
end
Finds dep
in this set.
lib/rubygems/test_case.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rubygems/test_case.rb, line 1403
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
Loads a Gem::Specification
from this set which has the given name
, version ver
, platform
. The source
is ignored.