LoginSignup
20

More than 5 years have passed since last update.

[Rails] rake taskの途中終了はreturnじゃなくてnext

Posted at

参考: http://stackoverflow.com/questions/2316475/how-do-i-return-early-from-a-rake-task

task :foo do
  puts "printed"
  next
  puts "never printed"
end

A Rake task is basically a block

とのことです。

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
20