From e44e2ef2e84012bd842228c8b86de776a9a334d6 Mon Sep 17 00:00:00 2001 From: why Date: Sun, 11 May 2003 06:32:13 +0000 Subject: * ext/syck/implicit.c, ext/syck/rubyext.c: transfer methods applied to native loading * ext/syck/token.c: fix for transfer methods on same indentation as nested mapping * lib/yaml/rubytypes.rb: all type names in lowercase git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/yaml/rubytypes.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/yaml/rubytypes.rb') diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb index b6f1e37705..727c31ca78 100644 --- a/lib/yaml/rubytypes.rb +++ b/lib/yaml/rubytypes.rb @@ -23,7 +23,7 @@ class Object end end -YAML.add_ruby_type( Object ) { |type, val| +YAML.add_ruby_type( 'object' ) { |type, val| type, obj_class = YAML.read_type_class( type, Object ) YAML.object_maker( obj_class, val ) } @@ -78,8 +78,8 @@ hash_proc = Proc.new { |type, val| end val } -YAML.add_builtin_type( /^map/, &hash_proc ) -YAML.add_ruby_type( Hash, &hash_proc ) +YAML.add_builtin_type( 'map', &hash_proc ) +YAML.add_ruby_type( 'hash', &hash_proc ) module YAML @@ -120,7 +120,7 @@ module YAML end end - YAML.add_ruby_type( :flexhash ) { |type, val| + YAML.add_ruby_type( 'flexhash' ) { |type, val| if Array === val p = FlexHash.new val.each { |v| @@ -159,7 +159,7 @@ class Struct end end -YAML.add_ruby_type( Struct ) { |type, val| +YAML.add_ruby_type( 'struct' ) { |type, val| type =~ /^struct:(\w+)/ if Hash === val type = $1 @@ -237,8 +237,8 @@ array_proc = Proc.new { |type, val| val.to_a end } -YAML.add_builtin_type( /^seq/, &array_proc ) -YAML.add_ruby_type( Array, &array_proc ) +YAML.add_builtin_type( 'seq', &array_proc ) +YAML.add_ruby_type( 'array', &array_proc ) # # String#to_yaml @@ -318,8 +318,8 @@ symbol_proc = Proc.new { |type, val| raise YAML::Error, "Invalid Symbol: " + val.inspect end } -YAML.add_ruby_type( Symbol, &symbol_proc ) -YAML.add_ruby_type( :sym, &symbol_proc ) +YAML.add_ruby_type( 'symbol', &symbol_proc ) +YAML.add_ruby_type( 'sym', &symbol_proc ) # # Range#to_yaml @@ -336,7 +336,7 @@ class Range end end -YAML.add_ruby_type( Range ) { |type, val| +YAML.add_ruby_type( 'range' ) { |type, val| if String === val and val =~ /^(.*[^.])(\.{2,3})([^.].*)$/ r1, rdots, r2 = $1, $2, $3 Range.new( YAML.try_implicit( r1 ), YAML.try_implicit( r2 ), rdots.length == 3 ) @@ -384,7 +384,7 @@ regexp_proc = Proc.new { |type, val| end } YAML.add_domain_type( "perl.yaml.org,2002", /^regexp/, ®exp_proc ) -YAML.add_ruby_type( Regexp, ®exp_proc ) +YAML.add_ruby_type( 'regexp', ®exp_proc ) # # Emit a Time object as an ISO 8601 timestamp -- cgit v1.2.3