Permalink
Browse files

* ext/psych/lib/psych/visitors/yaml_tree.rb: dumping strings with

  quotes should not have changed.  [ruby-core:59316] [Bug #9300]

* ext/psych/lib/psych.rb: fixed missing require.

* test/psych/test_string.rb: test
  • Loading branch information...
1 parent bfd62dc commit a479e141bfab70a21cdb3936d4a930c7b3885a9c @tenderlove tenderlove committed Jan 9, 2014
Showing with 14 additions and 1 deletion.
  1. +9 −0 CHANGELOG.rdoc
  2. +1 −1 lib/psych/visitors/yaml_tree.rb
  3. +4 −0 test/psych/test_string.rb
View
@@ -1,3 +1,12 @@
+Thu Jan 9 09:55:20 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: dumping strings with
+ quotes should not have changed. [ruby-core:59316] [Bug #9300]
+
+ * ext/psych/lib/psych.rb: fixed missing require.
+
+ * test/psych/test_string.rb: test
+
Wed Nov 27 06:40:18 2013 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/scalar_scanner.rb: fix support for negative
@@ -284,7 +284,7 @@ def visit_String o
quote = false
elsif o =~ /\n/
style = Nodes::Scalar::LITERAL
- elsif o =~ /^\W/
+ elsif o =~ /^\W[^"]*$/
style = Nodes::Scalar::DOUBLE_QUOTED
else
unless String === @ss.tokenize(o)
@@ -15,6 +15,10 @@ def initialize
end
end
+ def test_no_doublequotes_with_special_characters
+ assert_equal 2, Psych.dump(%Q{<%= ENV["PATH"] %>}).count('"')
+ end
+
def test_doublequotes_when_there_is_a_single
yaml = Psych.dump "@123'abc"
assert_match(/---\s*"/, yaml)

0 comments on commit a479e14

Please sign in to comment.