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

Pass through all options if present. #753

Merged
merged 1 commit into from
Feb 18, 2025
Merged

Conversation

ioquatix
Copy link
Member

@ioquatix ioquatix commented Feb 14, 2025

I understand there is a compatibility concern here 8e0076a

However, I'd like to try this out (check CI is passing).

@ioquatix
Copy link
Member Author

ioquatix commented Feb 14, 2025

For reference, it's also possible to achieve what I want using JSON::State.generate directly:

OPTIONS = {indent: "  ", space: " ", space_before: "", object_nl: "\n", array_nl: "\n"}

def self.output(file, value)
  ::JSON::State.generate(value, OPTIONS, file)
  file.puts
end

However, I'm not sure if JSON::State is considered stable public interface.

@byroot byroot merged commit b86a47d into ruby:master Feb 18, 2025
33 checks passed
@ioquatix ioquatix deleted the json-dump-options branch February 19, 2025 07:57
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