summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornick evans <[email protected]>2024-10-28 15:41:01 -0400
committergit <[email protected]>2025-05-01 17:52:13 +0000
commita397e4d4b0a0e7e8499a33ec760dba97ce494c63 ()
tree5781fd294aede7309847dbfd90c217c0067cfc63 /ext
parentbd1d6e8cd725e84addfac8583634458a624929ae (diff)
[ruby/psych] Add support for ruby 3.2 Data objects
https://.com/ruby/psych/commit/788b844c83
-rw-r--r--ext/psych/lib/psych/class_loader.rb1
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb22
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb10
3 files changed, 33 insertions, 0 deletions
@@ -6,6 +6,7 @@ module Psych
class ClassLoader # :nodoc:
BIG_DECIMAL = 'BigDecimal'
COMPLEX = 'Complex'
DATE = 'Date'
DATE_TIME = 'DateTime'
EXCEPTION = 'Exception'
@@ -197,6 +197,14 @@ module Psych
s
end
when /^!ruby\/object:?(.*)?$/
name = $1 || 'Object'
@@ -340,6 +348,20 @@ module Psych
list
end
def revive_hash hash, o, tagged= false
o.children.each_slice(2) { |k,v|
key = accept(k)
@@ -162,6 +162,16 @@ module Psych
alias :visit_Delegator :visit_Object
def visit_Struct o
tag = ['!ruby/struct', o.class.name].compact.join(':')