Skip to content

Instantly share code, notes, and snippets.

@devster31
Created August 15, 2017 14:30
Show Gist options
  • Save devster31/21bdeba2d8bf8f905d3256e0f902845b to your computer and use it in GitHub Desktop.
Save devster31/21bdeba2d8bf8f905d3256e0f902845b to your computer and use it in GitHub Desktop.
oneliner to dump YAML to JSON
#!/usr/bin/ruby
# ruby -ryaml -rjson -e 'puts YAML.load($stdin.read).to_json'
require 'json'
require 'yaml'
puts YAML.load($stdin.read).to_json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment