Created
February 24, 2012 13:51
-
-
Save flomotlik/1901055 to your computer and use it in GitHub Desktop.
Using Thor subcommands
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
require 'thor' | |
require "sub" | |
class MyApp < Thor | |
desc "parentcommand SUBCOMMAND", "Some Parent Command" | |
subcommand "sub", Sub | |
end | |
MyApp.start |
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
class Sub < Thor | |
desc "command", "an example task" | |
def command | |
puts "I'm a thor task!" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! perfect example. short, consie and clear