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
精彩评论