LoginSignup
0
1

More than 5 years have passed since last update.

RailsのThorの使い方

Last updated at Posted at 2018-11-12

ファイル名と格納場所

test.thorように「.thor」拡張式でBINのフォルダーに格納する
  私の場合は---→ D:\Ruby24-x64\bin

test.thor

class Test < Thor # Thorクラスを継承
  desc 'say [Name]', 'say task' # Usage Message, 詳細な説明
  def say(name) # publicで定義したメソッドが実行するタスク
    puts "Hello, #{name}!"
  end
end

実行方法

D:\app\test>thor test:say aaa
Hello, aaa!
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1