Hi, > I received a report from a Debian user: > <URL:http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=331050> [...] > $ ruby -ryaml -e 'puts YAML.dump(1234567890)' | ruby -ryaml -e 'p YAML.load(ARGF.read)' > /usr/lib/ruby/1.8/yaml.rb:133:in `transfer': allocator undefined for Bignum (TypeError) > from /usr/lib/ruby/1.8/yaml.rb:133:in `load' > from -e:1 > > It is a bug of Ruby 1.8.3. I think that YAML should be able to load > "!ruby/object:Bignum 1234567890". How about the following patch?: --- ext/syck/rubyext.c 27 Sep 2005 22:57:52 -0000 1.30.2.15 +++ ext/syck/rubyext.c 5 Oct 2005 10:24:16 -0000 @@ -1142,6 +1142,9 @@ } else if ( !NIL_P( target_class ) ) { + if (subclass == rb_cBignum) + obj = rb_str2inum(val, 10); + else obj = rb_obj_alloc( subclass ); if ( rb_respond_to( obj, s_yaml_initialize ) ) { Thank you. -- akira yamada <akira / ruby-lang.org>