[rubygems/rubygems] Remove forward slash in key regardless if it contains __
https://github.com/rubygems/rubygems/commit/33a02eec00
This commit is contained in:
parent
e854b050cc
commit
061e01ee50
@ -535,7 +535,7 @@ if you believe they were disclosed to a third party.
|
|||||||
content.transform_keys! do |k|
|
content.transform_keys! do |k|
|
||||||
if k.match?(/\A:(.*)\Z/)
|
if k.match?(/\A:(.*)\Z/)
|
||||||
k[1..-1].to_sym
|
k[1..-1].to_sym
|
||||||
elsif k.include?("__")
|
elsif k.include?("__") || k.match?(%r{/\Z})
|
||||||
if k.is_a?(Symbol)
|
if k.is_a?(Symbol)
|
||||||
k.to_s.gsub(/__/,".").gsub(%r{/\Z}, "").to_sym
|
k.to_s.gsub(/__/,".").gsub(%r{/\Z}, "").to_sym
|
||||||
else
|
else
|
||||||
|
@ -324,14 +324,19 @@ if you believe they were disclosed to a third party.
|
|||||||
temp_cred = File.join Gem.user_home, ".gem", "credentials"
|
temp_cred = File.join Gem.user_home, ".gem", "credentials"
|
||||||
FileUtils.mkdir_p File.dirname(temp_cred)
|
FileUtils.mkdir_p File.dirname(temp_cred)
|
||||||
File.open temp_cred, "w", 0o600 do |fp|
|
File.open temp_cred, "w", 0o600 do |fp|
|
||||||
fp.puts ":rubygems_api_key: 701229f217cdf23b1344c7b4b54ca97"
|
fp.puts ":rubygems_api_key: rubygems_b9ce70c306b3a2e248679fbbbd66722d408d3c8c4f00566c"
|
||||||
fp.puts ":other: a5fdbb6ba150cbb83aad2bb2fede64c"
|
fp.puts ":other: rubygems_9636a120106ea8b81fbc792188251738665711d2ece160c5"
|
||||||
|
fp.puts "http://localhost:3000: rubygems_be293ad9dd71550a012b17d848893b41960b811ce9312b47"
|
||||||
end
|
end
|
||||||
|
|
||||||
util_config_file
|
util_config_file
|
||||||
|
|
||||||
assert_equal({ :rubygems => "701229f217cdf23b1344c7b4b54ca97",
|
assert_equal(
|
||||||
:other => "a5fdbb6ba150cbb83aad2bb2fede64c" }, @cfg.api_keys)
|
{ :rubygems => "rubygems_b9ce70c306b3a2e248679fbbbd66722d408d3c8c4f00566c",
|
||||||
|
:other => "rubygems_9636a120106ea8b81fbc792188251738665711d2ece160c5",
|
||||||
|
"http://localhost:3000" => "rubygems_be293ad9dd71550a012b17d848893b41960b811ce9312b47" },
|
||||||
|
@cfg.api_keys
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_load_api_keys_bad_permission
|
def test_load_api_keys_bad_permission
|
||||||
|
Loading…
x
Reference in New Issue
Block a user