ruby-changes:18662
From: yugui <ko1@a...>
Date: Fri, 28 Jan 2011 11:25:44 +0900 (JST)
Subject: [ruby-changes:18662] Ruby:r30687 (ruby_1_9_2): merges r30587 from trunk into ruby_1_9_2.
yugui 2011-01-28 11:25:14 +0900 (Fri, 28 Jan 2011) New Revision: 30687 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30687 Log: merges r30587 from trunk into ruby_1_9_2. -- * ext/psych/lib/psych/visitors/json_tree.rb (visit_String): JSON strings should be dumped with double quotes. [ruby-core:34186] * test/psych/test_json_tree.rb: test for double quotes Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/ext/psych/lib/psych/visitors/json_tree.rb branches/ruby_1_9_2/test/psych/test_json_tree.rb branches/ruby_1_9_2/version.h Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 30686) +++ ruby_1_9_2/ChangeLog (revision 30687) @@ -1,3 +1,10 @@ +Tue Jan 18 02:46:55 2011 Aaron Patterson <aaron@t...> + + * ext/psych/lib/psych/visitors/json_tree.rb (visit_String): JSON + strings should be dumped with double quotes. [ruby-core:34186] + + * test/psych/test_json_tree.rb: test for double quotes + Sun Jan 16 22:06:30 2011 Yuki Sonoda (Yugui) <yugui@y...> * too/rbinstall.rb (install?(:ext, :comm, :gem)): no longer Index: ruby_1_9_2/ext/psych/lib/psych/visitors/json_tree.rb =================================================================== --- ruby_1_9_2/ext/psych/lib/psych/visitors/json_tree.rb (revision 30686) +++ ruby_1_9_2/ext/psych/lib/psych/visitors/json_tree.rb (revision 30687) @@ -19,7 +19,7 @@ end def visit_String o - @emitter.scalar o.to_s, nil, nil, false, true, Nodes::Scalar::ANY + @emitter.scalar o.to_s, nil, nil, false, true, Nodes::Scalar::DOUBLE_QUOTED end alias :visit_Symbol :visit_String Index: ruby_1_9_2/version.h =================================================================== --- ruby_1_9_2/version.h (revision 30686) +++ ruby_1_9_2/version.h (revision 30687) @@ -1,13 +1,13 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 164 +#define RUBY_PATCHLEVEL 165 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 #define RUBY_RELEASE_YEAR 2011 #define RUBY_RELEASE_MONTH 1 -#define RUBY_RELEASE_DAY 27 -#define RUBY_RELEASE_DATE "2011-01-27" +#define RUBY_RELEASE_DAY 28 +#define RUBY_RELEASE_DATE "2011-01-28" #include "ruby/version.h" Index: ruby_1_9_2/test/psych/test_json_tree.rb =================================================================== --- ruby_1_9_2/test/psych/test_json_tree.rb (revision 30686) +++ ruby_1_9_2/test/psych/test_json_tree.rb (revision 30687) @@ -3,11 +3,11 @@ module Psych class TestJSONTree < TestCase def test_string - assert_match(/(['"])foo\1/, Psych.to_json("foo")) + assert_match(/"foo"/, Psych.to_json("foo")) end def test_symbol - assert_match(/(['"])foo\1/, Psych.to_json(:foo)) + assert_match(/"foo"/, Psych.to_json(:foo)) end def test_nil @@ -36,8 +36,8 @@ json = Psych.to_json(list) assert_match(/]$/, json) assert_match(/^\[/, json) - assert_match(/['"]one['"]/, json) - assert_match(/['"]two['"]/, json) + assert_match(/"one"/, json) + assert_match(/"two"/, json) end end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/