问题
I just found a bug in one of the rake tasks shipped with Rails. Is there a way to monkey patch a rake task?
回答1:
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
来源:https://stackoverflow.com/questions/2412627/how-to-monkey-patch-a-rake-task-shipped-with-rails