LoginSignup
1
1

More than 5 years have passed since last update.

【Ruby】引数ありrakeの作り方と、呼び出し方

Last updated at Posted at 2015-12-05

hoge.rake

task :hoge, [:fuga] => :environment do |t, args|
  p args[:fuga]
end

ターミナル

rake "mock:hoge['私はQiita']"
"私はQiita" 

"" でくくる必要があるのと、[]の中に第一引数、第二引数と入れていく。

他にも方法はあります!

1
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
1
1