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

Use YAML.to_json instead of YAML.dump #233

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Use YAML.to_json instead of YAML.dump #233

wants to merge 2 commits into from

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Jun 2, 2014

No description provided.

We're not using any features of YAML outside of
dictionaries and lists (hashes and arrays), so why not
let our data be parseable by YAML _and_ JSON?
Copy link
Member

@etagwerker etagwerker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bf4 Are you still interested in merging these changes? What's the goal with this PR?

# Renders the result of the result_hash into a yaml serialization
# ready for writing out to a file.
#
# @return YAML
# A YAML object containing the results of the result generation
# process
def as_yaml
result_hash.to_yaml
YAML.to_json(result_hash)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bf4 This seems a bit confusing, shouldn't we try to rename the method to be as_json instead?

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

Successfully merging this pull request may close these issues.

2 participants