开发者

How to monkey patch a rake task shipped with Rails?

I just found a bug in one of the rake tasks shipped with Rails. Is there a way to monk开发者_如何学Pythoney patch a rake task?


Yes.

You can do something like this:

Rake::Task['doc:app'].clear

and then define your own task

namespace :doc do
  task :app do
    # work your magic
  end
end
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜