diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-20 01:33:19 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-20 01:33:19 +0000 |
commit | 3f15d35f83dc91e1e5af6d98e6f6fcd52abd1649 (patch) | |
tree | f677f8d0bff97ded1c0995f27158fb91d32966dd /lib/rubygems/test_case.rb | |
parent | 8552f7aa680e1f1a31d76dc9038d80248a445960 (diff) | |
download | ruby-3f15d35f83dc91e1e5af6d98e6f6fcd52abd1649.tar.gz |
* 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
Diffstat (limited to 'lib/rubygems/test_case.rb')
-rw-r--r-- | lib/rubygems/test_case.rb | 23 |
1 files changed, 22 insertions, 1 deletions
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 |