From 5e1c96af5323f757c9875ea1fb5b754e4dd257cd Mon Sep 17 00:00:00 2001 From: why Date: Thu, 22 May 2003 05:41:06 +0000 Subject: * ext/syck/rubyext.c (syck_parser_load): root-level false was returning nil. * ext/syck/token.c: root-level transfer method bug. * ext/syck/gram.c: root-level empty gave a parse error. * lib/yaml/rubytypes.rb: Symbol#to_yaml generating method call error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/yaml/rubytypes.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb index 666618e49c..ae5585db5d 100644 --- a/lib/yaml/rubytypes.rb +++ b/lib/yaml/rubytypes.rb @@ -3,6 +3,12 @@ require 'date' # Type conversions # +class Class + def to_yaml( opts = {} ) + raise ArgumentError, "can't dump anonymous class %s" % self.class + end +end + class Object def is_complex_yaml? true @@ -300,7 +306,7 @@ class Symbol def to_yaml( opts = {} ) YAML::quick_emit( nil, opts ) { |out| out << "!ruby/sym " - self.object_id2name.to_yaml( :Emitter => out ) + self.id2name.to_yaml( :Emitter => out ) } end end -- cgit v1.2.3