Skip to content

Instantly share code, notes, and snippets.

@stuartwakefield
Last active November 4, 2015 11:05
Show Gist options
  • Save stuartwakefield/a29dd155c822210f1043 to your computer and use it in GitHub Desktop.
Save stuartwakefield/a29dd155c822210f1043 to your computer and use it in GitHub Desktop.
Ruby script pipe YML files through to convert them to JSON
#!/usr/bin/env ruby
# Simple usage
# yml2json < my.yml > my.json
require 'yaml'
require 'json'
puts JSON.pretty_generate(YAML.load(ARGF.read))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment