Skip to content

Instantly share code, notes, and snippets.

@nickjacob
Created March 25, 2013 21:41
Show Gist options
  • Save nickjacob/5241055 to your computer and use it in GitHub Desktop.
Save nickjacob/5241055 to your computer and use it in GitHub Desktop.
I've been writing a lot of ruby scripts that I want to make more usable/modular, realized I need a common template/api for these things
# Script Template
# @author nickjacob
require 'pp'
def print_json json
pp json
end
def perform argv
while line = gets.chomp
print_json line
end
end
if __FILE__ == $0
perform ARGV
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment