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 | 811bf249cc2854cbb9e6ae3d90080fb67867e9f4 (patch) | |
tree | b1ac96e38ef670c683e12092084de165d11fe080 /lib/yaml | |
parent | 1a2900e232d02462aeb51e1aa10a6e7731c07a27 (diff) | |
download | ruby-811bf249cc2854cbb9e6ae3d90080fb67867e9f4.tar.gz ruby-811bf249cc2854cbb9e6ae3d90080fb67867e9f4.tar.xz ruby-811bf249cc2854cbb9e6ae3d90080fb67867e9f4.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@3955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml')
-rw-r--r-- | lib/yaml/emitter.rb | 2 | ||||
-rw-r--r-- | lib/yaml/rubytypes.rb | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/yaml/emitter.rb b/lib/yaml/emitter.rb index 66c7a6e81..0255cc7d0 100644 --- a/lib/yaml/emitter.rb +++ b/lib/yaml/emitter.rb @@ -286,7 +286,7 @@ module YAML @buffer.push( "" ) #p [ self.id, @level, :END ] if @level < 0 - header + @buffer.to_s[@headless..-1] + header + @buffer.to_s[@headless..-1].to_s end end end diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb index 2597c86a5..09aab9889 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| |