Last active
December 17, 2015 02:08
-
-
Save shiraji/5533075 to your computer and use it in GitHub Desktop.
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 | |
require 'thor' | |
class Test < Thor | |
class_option :help, :type => :boolean, :aliases => '-h', :desc => 'Thor test' | |
default_task :execute | |
desc "execute [OPTION]", "Test execute" | |
option :production, :type => :boolean, :aliases => '-p', :desc => "Run production DB server" | |
option :number, :type => :numeric, :aliases => '-n', :default => 3, :desc => "test number" | |
def execute | |
# DBオプション | |
if options[:production] then | |
@mode = 'PRODUCTION' | |
else | |
@mode = 'DEVELOPMENT' | |
end | |
puts @mode | |
puts options['number'] | |
end | |
end | |
Test.start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment