From baac6078e39a917beab1fa203205c38b319608b5 Mon Sep 17 00:00:00 2001 From: yugui Date: Fri, 28 Jan 2011 02:25:14 +0000 Subject: 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ ext/psych/lib/psych/visitors/json_tree.rb | 2 +- test/psych/test_json_tree.rb | 8 ++++---- version.h | 6 +++--- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f15df79c23..e9bdd2b086 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Jan 18 02:46:55 2011 Aaron Patterson + + * 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) * too/rbinstall.rb (install?(:ext, :comm, :gem)): no longer diff --git a/ext/psych/lib/psych/visitors/json_tree.rb b/ext/psych/lib/psych/visitors/json_tree.rb index 0ec1678a39..dcb5ddccae 100644 --- a/ext/psych/lib/psych/visitors/json_tree.rb +++ b/ext/psych/lib/psych/visitors/json_tree.rb @@ -19,7 +19,7 @@ module Psych 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 diff --git a/test/psych/test_json_tree.rb b/test/psych/test_json_tree.rb index 84bd36ce57..96e17be961 100644 --- a/test/psych/test_json_tree.rb +++ b/test/psych/test_json_tree.rb @@ -3,11 +3,11 @@ require_relative 'helper' 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 @@ module Psych 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 diff --git a/version.h b/version.h index ae3d30eca8..3703659d12 100644 --- a/version.h +++ b/version.h @@ -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" -- cgit v1.2.3