Skip to content

Instantly share code, notes, and snippets.

@heph
Created December 18, 2019 19:30
Show Gist options
  • Save heph/f5cf152cb1808cd9add0da413acdd2dd to your computer and use it in GitHub Desktop.
Save heph/f5cf152cb1808cd9add0da413acdd2dd to your computer and use it in GitHub Desktop.
Converts a yaml file to json with ruby. I'm pretty sure I stole this from the travis-ci project.
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'erb'
require 'json'
require 'yaml'
$stdout.puts JSON.pretty_generate(YAML.safe_load(ERB.new($stdin.read).result))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment