Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String quoting differs between 2.0.0 and 2.0.8 #232

Closed
segiddins opened this issue Apr 24, 2015 · 4 comments
Closed

String quoting differs between 2.0.0 and 2.0.8 #232

segiddins opened this issue Apr 24, 2015 · 4 comments

Comments

@segiddins
Copy link

In v2.0.0, which I believe shipped by default with Ruby 2.0, h = { k: './Hello' } would serialize to ---\n:k: ./Hello\n, whereas in 2.0.8, which I have on my 2.2.1 install, it serializes to ---\n:k: "./Hello"\n -- note the added quotes in the later version. This causes unwanted diffs when the same file is serialized by different ruby versions.

@segiddins
Copy link
Author

@tenderlove this is a breaking change for CocoaPods' users, it would be nice to know if there's anything we can do about it

@tenderlove
Copy link
Member

Sorry, how is this a "breaking change"?

@segiddins
Copy link
Author

Because the generated YAML strings are unequal (and thus textual diffing fails)

@tenderlove
Copy link
Member

Psych never makes a guarantee that the output will always be the same. It guarantees that any object you serialize will deserialize the same way, so I don't consider this to be a "breaking change". I am open to a patch that would make strings serialize how you want, but I reiterate: psych makes no guarantees about what the output YAML will look like, only that an object can serialize and deserialize successfully.

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

No branches or pull requests

2 participants