Skip to content

Instantly share code, notes, and snippets.

@kkenny
Created May 1, 2012 17:13
Show Gist options
  • Save kkenny/2569722 to your computer and use it in GitHub Desktop.
Save kkenny/2569722 to your computer and use it in GitHub Desktop.
json to ruby pp
#!/usr/bin/env ruby
## Author: Kameron Kenny, ExactTarget
## Usage:
## Output results to stdout:
## json_to_pp.rb file.json
## Output results to file:
## json_to_pp.rb file.json > file.rb
require 'pp'
require 'json'
f = ARGV[0]
json = File.read(f)
JSON.create_id = nil
content = JSON.parse(json)
pp content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment