#!/usr/bin/env ruby # jsontidy # POSSIBLE USAGE # [[Shell]] cat data.json | jsontidy # [[TextMate]] Cmd-A Cmd-Opt-R jsontidy # [[Vim] :%!jsontidy # alternate implementation: python -m simplejson.tool require 'rubygems' require 'json' x = JSON.parse STDIN.read puts JSON.pretty_generate(x)