diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-10 17:51:40 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-10 17:51:40 +0000 |
commit | 4f6779bac7b4e294bc473782d60cbd071f0d0f8d (patch) | |
tree | d37b54da20f8c0adf2d98e810aacc8259b0602ff /lib/rubygems/spec_fetcher.rb | |
parent | 31d355aaa9436e2b24efd5e6501cabd876267c46 (diff) | |
download | ruby-4f6779bac7b4e294bc473782d60cbd071f0d0f8d.tar.gz |
* lib/rubygems: Update to RubyGems master 4bdc4f2. Important changes
in this commit:
RubyGems now chooses the test server port reliably. Patch by akr.
Partial implementation of bundler's Gemfile format.
Refactorings to improve the new resolver.
Fixes bugs in the resolver.
* test/rubygems: Tests for the above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/spec_fetcher.rb')
-rw-r--r-- | lib/rubygems/spec_fetcher.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb index 4bef93351f..22fa68db69 100644 --- a/lib/rubygems/spec_fetcher.rb +++ b/lib/rubygems/spec_fetcher.rb @@ -18,6 +18,11 @@ class Gem::SpecFetcher attr_reader :latest_specs # :nodoc: ## + # Sources for this SpecFetcher + + attr_reader :sources # :nodoc: + + ## # Cache of all released specs attr_reader :specs # :nodoc: @@ -37,7 +42,16 @@ class Gem::SpecFetcher @fetcher = fetcher end - def initialize + ## + # Creates a new SpecFetcher. Ordinarily you want to use + # Gem::SpecFetcher::fetcher which uses the Gem.sources. + # + # If you need to retrieve specifications from a different +source+, you can + # send it as an argument. + + def initialize sources = nil + @sources = sources || Gem.sources + @update_cache = begin File.stat(Gem.user_home).uid == Process.uid @@ -197,7 +211,7 @@ class Gem::SpecFetcher errors = [] list = {} - Gem.sources.each_source do |source| + @sources.each_source do |source| begin names = case type when :latest |