Created
December 16, 2011 23:06
-
-
Save danott/1488435 to your computer and use it in GitHub Desktop.
Ruby Command Line Utility Boilerplate
This file contains hidden or 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
#!/usr/local/bin/ruby | |
puts "Running application" | |
class App | |
def initialize(args) | |
end | |
def action(input) | |
"input was #{input}" | |
end | |
end | |
app = App.new(ARGV[0] || 'Default') | |
while(true) | |
print 'input> ' | |
input = gets.strip | |
unless input=="" | |
exit if input=="exit" || input=="quit" | |
puts app.action(input) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment