[Rake-devel] Destroying and/or redefining a task

Adam Majer adamm at zombino.com
Wed Jan 30 00:29:30 EST 2008


Hi,

For example, let's say an application has a default rakefile includes
that include's a task defined as,


....
namespace :a
   task :b do
      blah_blah( blah )
   end
end
....


Then in the rakefile I have is


require 'default_tasks.rb'

namespace :a
   task :b do
      my_blah( foo_foo )
   end
end


I want the second task a:b to replace the default one. As it is right
now, the default one is executed as is my own task. So two questions arise,

  1. How do I get a task redefined?
  2. How can I remove the original task from available tasks?


Cheers,
Adam

PS. The a:b task is also called by some other tasks from the original
rakefile so a replacement or redefinition is probably what is best in my
case.



More information about the Rake-devel mailing list