summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2016-08-11 15:37:23 -0700
committerJohn Keiser <john@johnkeiser.com>2016-08-11 16:00:36 -0700
commitce8249416fbb6570cc0a01500aca2f01195840d3 (patch)
tree94497e48ed97b57e3b96cbca4a56248c19c95db5
parent4a4b837a2a37d0ac5dd04bb61a2fee19424a03ac (diff)
downloadbundler-ce8249416fbb6570cc0a01500aca2f01195840d3.tar.gz
Retry gem downloads
Fixes https://github.com/bundler/bundler/issues/4846
-rw-r--r--lib/bundler/rubygems_integration.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index a083247adc..c1bb6c7ab8 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -277,7 +277,9 @@ module Bundler
def download_gem(spec, uri, path)
uri = Bundler.settings.mirror_for(uri)
fetcher = Gem::RemoteFetcher.new(configuration[:http_proxy])
- fetcher.download(spec, uri, path)
+ Bundler::Retry.new("download gem #{uri}", Gem::RemoteFetcher::FetchError).attempts do
+ fetcher.download(spec, uri, path)
+ end
end
def security_policy_keys