* lib/yaml/rubytypes.rb (Symbol#yaml_new): YAML loading of quoted

Symbols broken. [ruby-Bugs:2535] (written by Aaron Schrab)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2006-01-10 03:05:40 +00:00
Родитель f825f3508e
Коммит 163224f639
3 изменённых файлов: 20 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Jan 10 12:00:48 2006 Aaron Schrab <aaron @nospam@ schrab.com>
* lib/yaml/rubytypes.rb (Symbol#yaml_new): YAML loading of quoted
Symbols broken. [ruby-Bugs:2535]
Tue Jan 10 07:26:52 2006 Tanaka Akira <akr@m17n.org>
* gc.c (gc_stress): renamed from always_gc and enabled by default.
@ -14,8 +19,9 @@ Mon Jan 9 14:25:00 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/Makefile.sub (OPTFLAGS): I have experienced trouble on y- flag,
(VisualC++6) so use -O2b2xg- if $(MSC_VER) < 1400. [ruby-core:7040]
* lib/webrick/httpservlet/filehandler.rb: fixed typo. (Kero van Gelder)
[ruby-core:7075]
Mon Jan 9 14:25:00 2006 Kero van Gelder <rubyforge @nospam@ kero.tmfweb.nl>
* lib/webrick/httpservlet/filehandler.rb: fixed typo. [ruby-core:7075]
Sun Jan 8 14:15:27 2006 Tanaka Akira <akr@m17n.org>

Просмотреть файл

@ -183,6 +183,7 @@ class Symbol
yaml_as "tag:ruby.yaml.org,2002:sym"
def Symbol.yaml_new( klass, tag, val )
if String === val
val = YAML::load( val ) if val =~ /\A(["']).*\1\z/
val.intern
else
raise YAML::TypeError, "Invalid Symbol: " + val.inspect

Просмотреть файл

@ -1225,6 +1225,17 @@ EOY
inspect_str = "[[...], [...]]"
assert_equal( inspect_str, YAML::load( a.to_yaml ).inspect )
end
#
# Test Symbol cycle
#
def test_symbol_cycle
#
# From Aaron Schrab [ruby-Bugs:2535]
#
assert_cycle(:"^foo")
end
end
if $0 == __FILE__