summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Moore <tmoore@incrementalism.net>2015-03-15 15:43:33 +1100
committerTim Moore <tmoore@incrementalism.net>2015-03-15 15:43:33 +1100
commite0436bb0153f8cf4ae70ce9348f0e233615acf69 (patch)
treed375cb920435a2b4cfc1249049d57bded3d20a93
parent5ccddd4c9fd8a9793396439b6c3eb20964323333 (diff)
downloadbundler-e0436bb0153f8cf4ae70ce9348f0e233615acf69.tar.gz
Make Fetcher take a Remote instead of a URI.
-rw-r--r--lib/bundler/fetcher.rb8
-rw-r--r--lib/bundler/source/rubygems.rb3
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index e23521aa0f..a60adcabb2 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -101,12 +101,12 @@ module Bundler
end
- def initialize(remote_uri)
+ def initialize(remote)
@redirect_limit = 5 # How many redirects to allow in one request
@api_timeout = 10 # How long to wait for each API call
@max_retries = 3 # How many retries for the API call
- @remote = configured_uri_for(remote_uri)
+ @remote = remote
Socket.do_not_reverse_lookup = true
connection # create persistent connection
@@ -396,10 +396,6 @@ module Bundler
private
- def configured_uri_for(uri)
- Source::Rubygems::Remote.new(uri)
- end
-
def fetch_uri
@fetch_uri ||= begin
if remote_uri.host == "rubygems.org"
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 81b6954f1b..8f504bcf7f 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -196,7 +196,8 @@ module Bundler
def fetchers
@fetchers ||= remotes.map do |uri|
- Bundler::Fetcher.new(uri)
+ remote = Source::Rubygems::Remote.new(uri)
+ Bundler::Fetcher.new(remote)
end
end