diff options
Diffstat (limited to 'lang/ruby18-base/patches/patch-co')
-rw-r--r-- | lang/ruby18-base/patches/patch-co | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/lang/ruby18-base/patches/patch-co b/lang/ruby18-base/patches/patch-co new file mode 100644 index 00000000000..cb2eb661080 --- /dev/null +++ b/lang/ruby18-base/patches/patch-co @@ -0,0 +1,52 @@ +$NetBSD: patch-co,v 1.1 2006/07/30 23:12:50 taca 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 = {} ) |