Created
March 25, 2013 21:41
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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