diff options
author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-11 06:32:13 +0000 |
---|---|---|
committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-11 06:32:13 +0000 |
commit | e44e2ef2e84012bd842228c8b86de776a9a334d6 (patch) | |
tree | 6798f736db01ce77147aa033335f78bd8a092ede /lib/yaml/rubytypes.rb | |
parent | 0b5d8d2d664a544e524a40082affa7c8aa0bc44d (diff) | |
download | ruby-e44e2ef2e84012bd842228c8b86de776a9a334d6.tar.gz |
* 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
Diffstat (limited to 'lib/yaml/rubytypes.rb')
-rw-r--r-- | lib/yaml/rubytypes.rb | 22 |
1 files changed, 11 insertions, 11 deletions
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 |