[ruby/psych] Fix dumping StringIO (and potentially others) on Ruby <= 2.7
StringIO
In Ruby < 3.0, the superclass of StringIO was actually already Data, but it doesn't have the expected shape. So, on these earlier versions it errors:
Data
NoMethodError: undefined method members' for #<StringIO:0x00005641dd5f2880> vendor/bundle/ruby/2.6.0/gems/psych-5.2.5/lib/psych/visitors/yaml_tree.rb:170:in visit_Data'
members' for #<StringIO:0x00005641dd5f2880> vendor/bundle/ruby/2.6.0/gems/psych-5.2.5/lib/psych/visitors/yaml_tree.rb:170:in
This test doesn't fail on 2.7, presumably because it can pull in a newer stringio version.
stringio
https://github.com/ruby/psych/commit/0f40f56268
[ruby/psych] Fix dumping
StringIO
(and potentially others) on Ruby <= 2.7In Ruby < 3.0, the superclass of StringIO was actually already
Data
,but it doesn't have the expected shape. So, on these earlier versions it errors:
This test doesn't fail on 2.7, presumably because it can pull in a newer
stringio
version.https://github.com/ruby/psych/commit/0f40f56268