mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 12:34:21 +00:00
[rubygems/rubygems] Avoid appending a final "/" when fallback_timeout is used in config
https://github.com/rubygems/rubygems/commit/a0af1baa2b
This commit is contained in:
parent
765d61593a
commit
0fb73a8eda
@ -493,7 +493,7 @@ module Bundler
|
||||
return {} unless valid_file
|
||||
serializer_class.load(file.read).inject({}) do |config, (k, v)|
|
||||
k = k.dup
|
||||
k << "/" if /https?:/i.match?(k) && !%r{/\Z}.match?(k)
|
||||
k << "/" if /https?:/i.match?(k) && !k.end_with?("/", "__#{FALLBACK_TIMEOUT_URI_OPTION.upcase}")
|
||||
k.gsub!(".", "__")
|
||||
|
||||
unless k.start_with?("#")
|
||||
|
||||
@ -358,6 +358,12 @@ end
|
||||
E
|
||||
expect(out).to eq("http://gems.example.org/ => http://gem-mirror.example.org/")
|
||||
end
|
||||
|
||||
it "allows configuring fallback timeout for each mirror, and does not duplicate configs", rubygems: ">= 3.5.12" do
|
||||
bundle "config set --global mirror.https://rubygems.org.fallback_timeout 1"
|
||||
bundle "config set --global mirror.https://rubygems.org.fallback_timeout 2"
|
||||
expect(File.read(home(".bundle/config"))).to include("BUNDLE_MIRROR").once
|
||||
end
|
||||
end
|
||||
|
||||
describe "quoting" do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user