开发者

rake task with easy interface

Right now I can do

rake report shipment_id=5

rake report do
  id = ENV['shipment_id]
end

However I want to simplify the interace to the user by having

rake report 5

How do I do that in rake?

Last resort would be to use ruby and then call rake internally but I want to 开发者_StackOverflow中文版check if I am missing some feature of rake?


This could be useful: Rails Rake: How to pass in arguments to a task with :environment

Although its only for newer versions of rake.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜