diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-22 00:27:02 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-22 00:27:02 +0000 |
commit | 615ac3593499f54fde4b1eb0fba66b6bd944821b () | |
tree | 1f0b0e97ee3dd51798658d53cee7eec976a83a97 /lib/rubygems/source.rb | |
parent | ff31b35f6a66f3c1548e3356d506ff65a574be7f (diff) |
Merge rubygems master branch from .com/rubygems/rubygems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/rubygems/source.rb | 29 |
1 files changed, 10 insertions, 19 deletions
@@ -16,7 +16,7 @@ class Gem::Source :released => 'specs', :latest => 'latest_specs', :prerelease => 'prerelease_specs', - } ## # The URI this source will fetch gems from. @@ -36,15 +36,6 @@ class Gem::Source end @uri = uri - @api_uri = nil - end - - ## - # Use an SRV record on the host to look up the true endpoint for the index. - - def api_uri # :nodoc: - require 'rubygems/remote_fetcher' - @api_uri ||= Gem::RemoteFetcher.fetcher.api_endpoint uri end ## @@ -87,9 +78,9 @@ class Gem::Source # Returns a Set that can fetch specifications from this source. def dependency_resolver_set # :nodoc: - return Gem::Resolver::IndexSet.new self if 'file' == api_uri.scheme - bundler_api_uri = api_uri + './api/v1/dependencies' begin fetcher = Gem::RemoteFetcher.fetcher @@ -140,9 +131,9 @@ class Gem::Source spec_file_name = name_tuple.spec_name - uri = api_uri + "#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}" - cache_dir = cache_dir uri local_spec = File.join cache_dir, spec_file_name @@ -152,9 +143,9 @@ class Gem::Source return spec if spec end - uri.path << '.rz' - spec = fetcher.fetch_path uri spec = Gem::Util.inflate spec if update_cache? then @@ -184,7 +175,7 @@ class Gem::Source file = FILES[type] fetcher = Gem::RemoteFetcher.fetcher file_name = "#{file}.#{Gem.marshal_version}" - spec_path = api_uri + "#{file_name}.gz" cache_dir = cache_dir spec_path local_file = File.join(cache_dir, file_name) retried = false @@ -212,7 +203,7 @@ class Gem::Source def download(spec, dir=Dir.pwd) fetcher = Gem::RemoteFetcher.fetcher - fetcher.download spec, api_uri.to_s, dir end def pretty_print q # :nodoc: @@ -220,7 +211,7 @@ class Gem::Source q.breakable q.text @uri.to_s - if api = api_uri q.breakable q.text 'API URI: ' q.text api.to_s |