Skip to content

Instantly share code, notes, and snippets.

@groundwater
Created June 24, 2013 17:49
Show Gist options
  • Save groundwater/5852017 to your computer and use it in GitHub Desktop.
Save groundwater/5852017 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'json'
dat = {}
STDIN.read.split("\n")[4..-1].each do |line|
split = line.split(':')
if split.length > 1
lhs = split[1].strip.split(/\s+/)
if lhs.length > 1
dat[split[0]] = lhs
else
dat[split[0]] = lhs[0]
end
end
end
puts JSON.pretty_generate dat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment