diff options
author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-20 06:50:20 +0000 |
---|---|---|
committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-20 06:50:20 +0000 |
commit | d578f9d32e4c13df9ebf51873ae335c5e5a795ce (patch) | |
tree | defcbbf25c171d2ef655ea1e0e2df426491ab91e /lib/yaml/basenode.rb | |
parent | 34b3f481dc2e92aaf477f4ec49a0b3bf0274bbf1 (diff) |
* ext/syck/emitter.c (syck_scan_scalar): prevent indicators from
appearing alone or at the end of plain scalars. [ruby-core:5826]
* ext/syck/emitter.c (syck_emit_scalar): treat typed scalar nodes
as complex keys.
* lib/syck.h: version 0.60.
* lib/yaml/basenode.rb (YAML::BaseNode#at): transform keys during
key searches.
* ext/syck/rubyext.c: loading of binary-typed nodes. prevent
emission of plain strings that look like symbols, but which aren't.
* ext/syck/emitter.c (syck_emit): passing an int* value to the
long* parameter causes unaligned access on LP64 systems.
[ruby-dev:27161]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml/basenode.rb')
-rw-r--r-- | lib/yaml/basenode.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/yaml/basenode.rb b/lib/yaml/basenode.rb index a98f6d890a..7072b1dcd6 100644 --- a/lib/yaml/basenode.rb +++ b/lib/yaml/basenode.rb @@ -67,8 +67,8 @@ module YAML end def at( seg ) - if Hash === @value and @value.has_key?( seg ) - @value[seg][1] + if Hash === @value + self[seg] elsif Array === @value and seg =~ /\A\d+\Z/ and @value[seg.to_i] @value[seg.to_i] end @@ -99,8 +99,8 @@ module YAML @value.collect { |v| idx += 1 if Hash === @value - match_init = [v[0], v[1][1]] - match_deep = v[1][1].match_segment( ypath, depth ) + match_init = [v[0].transform, v[1]] + match_deep = v[1].match_segment( ypath, depth ) else match_init = [idx, v] match_deep = v.match_segment( ypath, depth ) @@ -127,7 +127,7 @@ module YAML @value.collect { |h| idx += 1 if Hash === @value - [h[0], h[1][1]] + [h[0].transform, h[1]] else [idx, h] end @@ -182,9 +182,9 @@ module YAML # We want the node to act like as Hash # if it is. # - def []( *k ) + def []( *key ) if Hash === @value - v = @value.[]( *k ) + v = @value.detect { |k,v| k.transform == key.first } v[1] if v elsif Array === @value @value.[]( *k ) |