diff options
author | Michael Peters <mtpeters@us.ibm.com> | 2016-08-04 16:08:56 -0400 |
---|---|---|
committer | Michael Peters <mtpeters@us.ibm.com> | 2016-08-04 16:08:56 -0400 |
commit | 4b249e66f4d0de32762fd41a6466d28848f60946 (patch) | |
tree | 846aca9dfe67696fec84d06210ba3ac36183c5a8 /lib | |
parent | 9dd84228ddf50af118efbc68bf341c0b1eb00e1a (diff) | |
download | bundler-4b249e66f4d0de32762fd41a6466d28848f60946.tar.gz |
enables BUNDLE_MIRROR__HOSTNAME environment variables
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/mirror.rb | 3 | ||||
-rw-r--r-- | lib/bundler/settings.rb | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/lib/bundler/mirror.rb b/lib/bundler/mirror.rb index 655d2b3d07..7d872966ee 100644 --- a/lib/bundler/mirror.rb +++ b/lib/bundler/mirror.rb @@ -43,7 +43,8 @@ module Bundler private def fetch_valid_mirror_for(uri) - mirror = (@mirrors[URI(uri.to_s.downcase)] || Mirror.new(uri)).validate!(@prober) + host = Settings.normalize_uri(URI(uri.to_s).host) + mirror = (@mirrors[URI(uri.to_s.downcase)] || @mirrors[host] || Mirror.new(uri)).validate!(@prober) mirror = Mirror.new(uri) unless mirror.valid? mirror end diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 0c846d195c..f69b035d65 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -289,11 +289,7 @@ module Bundler def self.normalize_uri(uri) uri = uri.to_s uri = "#{uri}/" unless uri =~ %r{/\Z} - uri = URI(uri) - unless uri.absolute? - raise ArgumentError, "Gem sources must be absolute. You provided '#{uri}'." - end - uri + URI(uri) end end end |