summaryrefslogtreecommitdiff
path: root/lib/rubygems/psych_tree.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/psych_tree.rb')
-rw-r--r--lib/rubygems/psych_tree.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/rubygems/psych_tree.rb b/lib/rubygems/psych_tree.rb
index 6f399a289e..24857adb9d 100644
--- a/lib/rubygems/psych_tree.rb
+++ b/lib/rubygems/psych_tree.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Gem
if defined? ::Psych::Visitors
class NoAliasYAMLTree < Psych::Visitors::YAMLTree
@@ -7,12 +8,16 @@ module Gem
end unless respond_to? :create
def visit_String(str)
- return super unless str == '=' # or whatever you want
+ return super unless str == "=" # or whatever you want
quote = Psych::Nodes::Scalar::SINGLE_QUOTED
@emitter.scalar str, nil, nil, false, true, quote
end
+ def visit_Hash(o)
+ super(o.compact)
+ end
+
# Noop this out so there are no anchors
def register(target, obj)
end