$NetBSD: patch-co,v 1.1.2.2 2006/07/31 22:43:13 salo Exp $

--- lib/yaml/rubytypes.rb.orig	2005-09-20 15:46:45.000000000 +0900
+++ lib/yaml/rubytypes.rb
@@ -183,6 +183,7 @@ class Symbol
     yaml_as "tag:ruby.yaml.org,2002:sym"
     def Symbol.yaml_new( klass, tag, val )
         if String === val
+            val = YAML::load( val ) if val =~ /\A(["']).*\1\z/
             val.intern
         else
             raise YAML::TypeError, "Invalid Symbol: " + val.inspect
@@ -352,7 +353,17 @@ class Date
 	end
 end
 
-class Numeric
+class Integer
+    yaml_as "tag:yaml.org,2002:int"
+	def to_yaml( opts = {} )
+		YAML::quick_emit( nil, opts ) do |out|
+            out.scalar( "tag:yaml.org,2002:int", self.to_s, :plain )
+        end
+	end
+end
+
+class Float
+    yaml_as "tag:yaml.org,2002:float"
 	def to_yaml( opts = {} )
 		YAML::quick_emit( nil, opts ) do |out|
             str = self.to_s
@@ -363,19 +374,11 @@ class Numeric
             elsif str == "NaN"
                 str = ".NaN"
             end
-            out.scalar( taguri, str, :plain )
+            out.scalar( "tag:yaml.org,2002:float", str, :plain )
         end
 	end
 end
 
-class Fixnum
-    yaml_as "tag:yaml.org,2002:int"
-end
-
-class Float
-    yaml_as "tag:yaml.org,2002:float"
-end
-
 class TrueClass
     yaml_as "tag:yaml.org,2002:bool#yes"
 	def to_yaml( opts = {} )
