diff options
author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-18 01:06:00 +0000 |
---|---|---|
committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-18 01:06:00 +0000 |
commit | d21bd1c06dbd04b89cdf4d50ce85fede95a7bcc9 (patch) | |
tree | b1ac96e38ef670c683e12092084de165d11fe080 /lib/yaml/rubytypes.rb | |
parent | ae28f1b6b3b22afb529f599385d1f2af258624e9 (diff) | |
download | ruby-d21bd1c06dbd04b89cdf4d50ce85fede95a7bcc9.tar.gz |
* ext/syck/rubyext.c (rb_syck_load_handler): merge key implemented.
* ext/syck/rubyext.c (transfer_find_i): removed use of String#=~ in favor
of Regexp#match.
* lib/yaml.rb: YAML::try_implicit returns.
* lib/yaml/rubytypes.rb: Regexps added for type matching.
* lib/yaml/emitter.rb: fix String + nil error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml/rubytypes.rb')
-rw-r--r-- | lib/yaml/rubytypes.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb index 2597c86a54..09aab98895 100644 --- a/lib/yaml/rubytypes.rb +++ b/lib/yaml/rubytypes.rb @@ -30,7 +30,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 ) } @@ -86,7 +86,7 @@ hash_proc = Proc.new { |type, val| val } YAML.add_builtin_type( 'map', &hash_proc ) -YAML.add_ruby_type( 'hash', &hash_proc ) +YAML.add_ruby_type( /^hash/, &hash_proc ) module YAML @@ -166,7 +166,7 @@ class Struct end end -YAML.add_ruby_type( 'struct' ) { |type, val| +YAML.add_ruby_type( /^struct/ ) { |type, val| if Hash === val struct_type = nil @@ -238,7 +238,7 @@ array_proc = Proc.new { |type, val| end } YAML.add_builtin_type( 'seq', &array_proc ) -YAML.add_ruby_type( 'array', &array_proc ) +YAML.add_ruby_type( /^array/, &array_proc ) # # Exception#to_yaml @@ -262,7 +262,7 @@ class Exception end end -YAML.add_ruby_type( 'exception' ) { |type, val| +YAML.add_ruby_type( /^exception/ ) { |type, val| type, obj_class = YAML.read_type_class( type, Exception ) o = YAML.object_maker( obj_class, { 'mesg' => val.delete( 'message' ) }, true ) val.each_pair { |k,v| |