diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-28 02:25:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-28 02:25:14 +0000 |
commit | baac6078e39a917beab1fa203205c38b319608b5 (patch) | |
tree | 44462fb2b0443a39e6d87b52cf640b72fc0fda33 | |
parent | a152da5fcd247d723cfc5e77a4a33ab1877ff636 (diff) |
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
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ext/psych/lib/psych/visitors/json_tree.rb | 2 | ||||
-rw-r--r-- | test/psych/test_json_tree.rb | 8 | ||||
-rw-r--r-- | version.h | 6 |
4 files changed, 15 insertions, 8 deletions
@@ -1,3 +1,10 @@ +Tue Jan 18 02:46:55 2011 Aaron Patterson <aaron@tenderlovemaking.com> + + * 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@yugui.jp> * 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 @@ -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" |