Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit b90076e85c3b2e29a4e6bd56b01c03d77b2bc1cd 1 parent 73b046d
@tenderlove tenderlove authored
View
9 ChangeLog
@@ -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
+
Thu Jan 9 09:51:00 2014 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/visitors/to_ruby.rb: anonymous structs
View
1  ext/psych/lib/psych.rb
@@ -14,6 +14,7 @@
require 'psych/json/tree_builder'
require 'psych/json/stream'
require 'psych/handlers/document_stream'
+require 'psych/class_loader'
###
# = Overview
View
2  ext/psych/lib/psych/visitors/yaml_tree.rb
@@ -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)
View
4 test/psych/test_string.rb
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.