Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update psych to tenderlove/psych@d5757ea #434

Merged
merged 1 commit into from

3 participants

@atambo
Collaborator

I would :heart: if this got into 1.7.2 so that the transition from 1.8 mode yaml to 1.9 mode yaml is more consistent. This is basically the only thing blocking my app from switching to 1.9 mode in jruby.

There were only 3 commits since @headius last updated psych so it was pretty safe.

@BanzaiMan
Owner

I'd be glad to merge it if it's a release. (Assuming that the tests pass.) (cc @tenderlove)

@tenderlove

:heart: seems good. Though I would like to get advice about future maintenance of psych. I need to figure out how to make release for JRuby in a non-painful way.

@BanzaiMan BanzaiMan merged commit 3d5705f into jruby:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 9, 2012
  1. @atambo
This page is out of date. Refresh to see the latest.
View
1  lib/ruby/1.9/psych/deprecated.rb
@@ -21,6 +21,7 @@ def self.quick_emit thing, opts = {}, &block # :nodoc:
target.psych_to_yaml unless opts[:nodump]
end
+ # This method is deprecated, use Psych.load_stream instead.
def self.load_documents yaml, &block
if $VERBOSE
warn "#{caller[0]}: load_documents is deprecated, use load_stream"
View
3  lib/ruby/1.9/psych/visitors/yaml_tree.rb
@@ -242,6 +242,9 @@ def visit_String o
elsif o =~ /\n/
quote = true
style = Nodes::Scalar::LITERAL
+ elsif o =~ /^\W/
+ quote = true
+ style = Nodes::Scalar::DOUBLE_QUOTED
else
quote = !(String === @ss.tokenize(o))
plain = !quote
View
6 test/externals/ruby1.9/psych/test_yaml.rb
@@ -1271,4 +1271,10 @@ def test_multiline_string_uses_literal_style
yaml = Psych.dump("multi\nline\nstring")
assert_match("|", yaml)
end
+
+ def test_string_starting_with_non_word_character_uses_double_quotes_without_exclamation_mark
+ yaml = Psych.dump("@123'abc")
+ assert_match("\"", yaml)
+ refute_match("!", yaml)
+ end
end
Something went wrong with that request. Please try again.