diff options
author | Pablo Carranza <pcarranza@gmail.com> | 2015-12-02 22:38:17 +0000 |
---|---|---|
committer | Pablo Carranza <pcarranza@gmail.com> | 2015-12-27 22:19:54 +0100 |
commit | abc92bf609863a1fc8045461d3b4d88bead92322 (patch) | |
tree | f6e766fd55b99bc4d83f03e5db0ac303879c51e8 /lib/bundler/settings.rb | |
parent | ba0bac9761408f98b9ca806bbfd52b1de414513d (diff) | |
download | bundler-abc92bf609863a1fc8045461d3b4d88bead92322.tar.gz |
WIP - it can parse the keys correctly
Diffstat (limited to 'lib/bundler/settings.rb')
-rw-r--r-- | lib/bundler/settings.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 528d4f6aa2..3bf280dd37 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -66,7 +66,7 @@ module Bundler # Settings keys are all downcased normalized_key = normalize_uri(uri.to_s.downcase) - gem_mirrors[normalized_key] || uri + (gem_mirrors[normalized_key] || Mirror.new(uri)).uri end def credentials_for(uri) @@ -76,8 +76,17 @@ module Bundler def gem_mirrors all.inject({}) do |h, k| if k =~ /^mirror\./ - uri = normalize_uri($') - h[uri] = normalize_uri(self[k]) + uri = $' + if uri =~ /\.fallback_timeout\/$/ + uri = normalize_uri($`) + mirror = h[uri] || Mirror.new() + mirror.fallback_timeout = self[k].to_i + else + uri = normalize_uri(uri) + mirror = h[uri] || Mirror.new() + mirror.uri = normalize_uri(self[k]) + end + h[uri] = mirror end h end |