Created
April 6, 2013 06:52
-
-
Save chikadance/5325185 to your computer and use it in GitHub Desktop.
thor
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 "rubygems" | |
require "thor" | |
class ThorExample < Thor | |
desc "start", "start sever" | |
method_option :environment, :default => "development", :aliases => "-e", | |
:desc => "which environment you want server run." | |
method_option :daemon, :type => :boolean, :default => false, :aliases => "-d", | |
:desc => "running on daemon mode?" | |
def start | |
puts "start #{options.inspect}" | |
end | |
desc "stop", "stop server" | |
method_option :delay, :default => 0, :aliases => "-d", | |
:desc => "wait server finish it's job" | |
def stop | |
puts "stop" | |
end | |
end | |
ThorExample.start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment