-
-
Save daneharrigan/1469785 to your computer and use it in GitHub Desktop.
sample thor task
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/bin/env ruby | |
require "thor" | |
class Foo < Thor | |
desc :foo, "This is the foo description" | |
def speak | |
puts "foo!!!" | |
end | |
desc :arg, "Take an argument" | |
def arg(argument) | |
puts "** #{argument} **" | |
end | |
desc :flag, "Takes flags" | |
method_options :foo => :string, :bar => :boolean | |
def flag | |
puts options.inspect | |
end | |
end | |
Foo.start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment