Skip to content

Commit 43fde88

Browse files
committed
merge revision(s) 44531: [Backport ruby#9300]
* ext/psych/lib/psych/visitors/yaml_tree.rb: dumping strings with quotes should not have changed. [ruby-core:59316] [Bug ruby#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/branches/ruby_2_1@45079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 21b0096 commit 43fde88

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Fri Feb 21 23:00:34 2014 Aaron Patterson <[email protected]>
2+
3+
* ext/psych/lib/psych/visitors/yaml_tree.rb: dumping strings with
4+
quotes should not have changed. [ruby-core:59316] [Bug #9300]
5+
6+
* ext/psych/lib/psych.rb: fixed missing require.
7+
8+
* test/psych/test_string.rb: test
9+
110
Sun Feb 2 05:48:42 2014 Eric Wong <[email protected]>
211

312
* io.c (rb_io_syswrite): add RB_GC_GUARD

ext/psych/lib/psych.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
require 'psych/json/tree_builder'
1515
require 'psych/json/stream'
1616
require 'psych/handlers/document_stream'
17+
require 'psych/class_loader'
1718

1819
###
1920
# = Overview

ext/psych/lib/psych/visitors/yaml_tree.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def visit_String o
284284
quote = false
285285
elsif o =~ /\n/
286286
style = Nodes::Scalar::LITERAL
287-
elsif o =~ /^\W/
287+
elsif o =~ /^\W[^"]*$/
288288
style = Nodes::Scalar::DOUBLE_QUOTED
289289
else
290290
unless String === @ss.tokenize(o)

test/psych/test_string.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def initialize
1515
end
1616
end
1717

18+
def test_no_doublequotes_with_special_characters
19+
assert_equal 2, Psych.dump(%Q{<%= ENV["PATH"] %>}).count('"')
20+
end
21+
1822
def test_doublequotes_when_there_is_a_single
1923
yaml = Psych.dump "@123'abc"
2024
assert_match(/---\s*"/, yaml)

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.1"
22
#define RUBY_RELEASE_DATE "2014-02-21"
3-
#define RUBY_PATCHLEVEL 43
3+
#define RUBY_PATCHLEVEL 44
44

55
#define RUBY_RELEASE_YEAR 2014
66
#define RUBY_RELEASE_MONTH 2

0 commit comments

Comments
 (0)