[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Rake question: How to call a task from a different namespace.

Eric Hodel

8/20/2007 8:44:00 PM

On Aug 20, 2007, at 12:48, Wayne E. Seguin wrote:

> How does one call from inside a namespace, a task from another
> namespace?
>
> namespace :foo do
> task :a do
> puts "Hello from task a!"
> end
> end
>
> namespace :bar do
> task :b do
> Rake::Task[:foo][:a] # How to call foo:a ???
> end
> end

Rake::Task['foo:a'].invoke

#invoke will only run a task once. If you want to force it to run
(minus any prerequisites) call #execute.

--
Poor workers blame their tools. Good workers build better tools. The
best workers get their tools to do the work for them. -- Syndicate Wars