Skip to content

Instantly share code, notes, and snippets.

@daneharrigan
Created December 13, 2011 00:16
Show Gist options
  • Save daneharrigan/1469785 to your computer and use it in GitHub Desktop.
Save daneharrigan/1469785 to your computer and use it in GitHub Desktop.
sample thor task
#!/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