Strings that start with non-word characters should double quote without exclamation mark #106

Merged
merged 1 commit into from Dec 9, 2012

Projects

None yet

2 participants

@atambo
Contributor
atambo commented Dec 8, 2012
Psych.dump("@123'abc")

Before this commit:

--- ! '@123''abc'

After this commit:

--- "@123'abc"

This makes yaml output look much cleaner.

@tenderlove
Member

I'm not sure. I buy the argument for using literal style for multiline strings, but why for strings like this? I think it would be better if we just got rid of the ! and made it:

--- '!123abc'

WDYT?

@atambo
Contributor
atambo commented Dec 8, 2012

I'd be happy with with removing the ! as that is the confusing part.

@atambo
Contributor
atambo commented Dec 8, 2012

@tenderlove, I've updated the commit. Looks even cleaner, thanks!

@atambo atambo Strings that start with non-word characters should double quote witho…
…ut exclamation mark

Before this commit:

--- ! '@123''abc'

After this commit:

--- "@123'abc"
086fe08
@atambo
Contributor
atambo commented Dec 9, 2012

I've also changed it to use double quotes instead of single quotes because when a string contains single quotes it just adds another single quote which splits the string in half instead of escaping it.

@tenderlove
Member

Great, thanks! ❤️

@tenderlove tenderlove merged commit d5757ea into ruby:master Dec 9, 2012

1 check passed

default The Travis build passed
Details
@Exoth Exoth referenced this pull request Sep 2, 2013
Closed

Double quotes #157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment