From 0b392535df8ef68c969a2900e146d8b91f020706 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Tue, 5 Aug 2014 18:41:46 +0000 Subject: * ext/psych/lib/psych/visitors/to_ruby.rb: backwards compatibility for hashes emitted by Syck. Github #198 * test/psych/test_hash.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych/visitors/to_ruby.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext/psych') diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb index 2f84b100d2..234cabc7f9 100644 --- a/ext/psych/lib/psych/visitors/to_ruby.rb +++ b/ext/psych/lib/psych/visitors/to_ruby.rb @@ -201,6 +201,8 @@ module Psych class_loader.rational h = Hash[*o.children.map { |c| accept c }] register o, Rational(h['numerator'], h['denominator']) + elsif name == 'Hash' + revive_hash(register(o, {}), o) else obj = revive((resolve_class(name) || class_loader.object), o) obj -- cgit v1.2.3