diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-12-14 19:49:16 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2019-12-15 16:41:10 +0900 |
commit | 38002a8adbd98266426940d829429a30af0622a4 (patch) | |
tree | db01bcc2653ba0230a07345c4a3c877246dfe473 /lib/bundler/settings.rb | |
parent | e2b192f7d5b4f0e2133bb6cf03cfc609258826be (diff) |
Prepare to release bundler-2.1.0
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2753
Diffstat (limited to 'lib/bundler/settings.rb')
-rw-r--r-- | lib/bundler/settings.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 2074070e3e..afbb02397c 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "uri" - module Bundler class Settings autoload :Mirror, File.expand_path("mirror", __dir__) @@ -152,7 +150,11 @@ module Bundler end def mirror_for(uri) - uri = URI(uri.to_s) unless uri.is_a?(URI) + if uri.is_a?(String) + require_relative "vendored_uri" + uri = Bundler::URI(uri) + end + gem_mirrors.for(uri.to_s).uri end @@ -421,7 +423,8 @@ module Bundler suffix = $3 end uri = "#{uri}/" unless uri.end_with?("/") - uri = URI(uri) + require_relative "vendored_uri" + uri = Bundler::URI(uri) unless uri.absolute? raise ArgumentError, format("Gem sources must be absolute. You provided '%s'.", uri) end |