From 3f15d35f83dc91e1e5af6d98e6f6fcd52abd1649 Mon Sep 17 00:00:00 2001 From: drbrain Date: Sun, 20 Oct 2013 01:33:19 +0000 Subject: * lib/rubygems: Update RubyGems to master 0886307. This commit improves documentation and should bring ruby above 75% documented on rubyci. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/test_case.rb | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'lib/rubygems/test_case.rb') diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index 1e6d9feeeb..19d3cfd134 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -1117,25 +1117,46 @@ Also, a list: return name, vendor_spec.version, directory end + ## + # The StaticSet is a static set of gem specifications used for testing only. + # It is available by requiring Gem::TestCase. + class StaticSet + + ## + # Creates a new StaticSet for the given +specs+ + def initialize(specs) @specs = specs end + ## + # Adds +spec+ to this set. + def add spec @specs << spec end + ## + # Finds +dep+ in this set. + def find_spec(dep) @specs.reverse_each do |s| return s if dep.matches_spec? s end end + ## + # Finds all gems matching +dep+ in this set. + def find_all(dep) @specs.find_all { |s| dep.matches_spec? s } end + ## + # Loads a Gem::Specification from this set which has the given +name+, + # version +ver+, +platform+. The +source+ is ignored. + def load_spec name, ver, platform, source dep = Gem::Dependency.new name, ver spec = find_spec dep @@ -1145,7 +1166,7 @@ Also, a list: end end - def prefetch(reqs) + def prefetch reqs # :nodoc: end end -- cgit v1.2.3