summaryrefslogtreecommitdiff
path: root/lib/rubygems/config_file.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2023-04-17 19:57:36 +0900
committergit <[email protected]>2023-04-19 06:56:20 +0000
commit7b959f628801d9f411a2dcc231c25a06e9d6234f ()
tree7fc585e4387041edff2c87dd443f3ad02295f072 /lib/rubygems/config_file.rb
parent30b3290f266609d502791ec5d2edb4885d89d462 (diff)
[rubygems/rubygems] Move all changes only in RubyGems
https://.com/rubygems/rubygems/commit/d842e2092f
-rw-r--r--lib/rubygems/config_file.rb38
1 files changed, 36 insertions, 2 deletions
@@ -320,6 +320,10 @@ if you believe they were disclosed to a third party.
config = load_file(credentials_path).merge(host => api_key)
dirname = File.dirname credentials_path
require "fileutils"
FileUtils.mkdir_p(dirname)
@@ -351,10 +355,36 @@ if you believe they were disclosed to a third party.
return {} unless filename && !filename.empty? && File.exist?(filename)
begin
- content = Bundler::YAMLSerializer.load(File.read(filename), is_rubygems: true)
if content.is_a? Hash
content.transform_values! do |v|
- if (v.is_a?(Hash) || v.is_a?(String)) && v.empty?
nil
else
v
@@ -494,6 +524,10 @@ if you believe they were disclosed to a third party.
yaml_hash[key.to_s] = value
end
require "bundler/yaml_serializer"
Bundler::YAMLSerializer.dump(yaml_hash)
end