Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aleofreddi/f800b25fe19e87f89d341ae29edcc36e to your computer and use it in GitHub Desktop.
Save aleofreddi/f800b25fe19e87f89d341ae29edcc36e to your computer and use it in GitHub Desktop.
one liner yaml2json & json2yaml
# yaml2json
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' < hello.yaml
# json2yaml
ruby -ryaml -rjson -e 'puts YAML.dump(JSON.load(ARGF))' < hello.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment