summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2014-07-15 16:56:09 +1000
committerTim Moore <tmoore@incrementalism.net>2014-07-30 14:16:35 +1000
commit9af2172e6dc6b29dc24f92a27b7a385faa952ba3 (patch)
treeb508b49005c72c5eb23d3792b8f6875b9e672b17
parent1a1b4dece5f6b8727b5b801afc7d4298cac2047e (diff)
downloadbundler-9af2172e6dc6b29dc24f92a27b7a385faa952ba3.tar.gz
Restore original Rubygems sources after fetching.
-rw-r--r--lib/bundler/fetcher.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index eb8ad25315..d1ddc55449 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -316,7 +316,8 @@ module Bundler
# fetch from modern index: specs.4.8.gz
def fetch_all_remote_specs
- Bundler.rubygems.sources = ["#{@remote_uri}"]
+ old_sources = Bundler.rubygems.sources
+ Bundler.rubygems.sources = [@remote_uri.to_s]
Bundler.rubygems.fetch_all_remote_specs
rescue Gem::RemoteFetcher::FetchError, OpenSSL::SSL::SSLError => e
case e.message
@@ -330,6 +331,8 @@ module Bundler
Bundler.ui.trace e
raise HTTPError, "Could not fetch specs from #{uri}"
end
+ ensure
+ Bundler.rubygems.sources = old_sources
end
def well_formed_dependency(name, *requirements)