Created
March 14, 2019 20:20
-
-
Save djmetzle/1da2112e84967202feadc3947b384a0c to your computer and use it in GitHub Desktop.
YAML to JSON Converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
require 'json' | |
x = <<-HEREDOC | |
--- | |
some: | |
- yaml: foo | |
here: bar | |
HEREDOC | |
puts JSON.pretty_generate YAML.load x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment