[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

[Rake] call a task of a namespace from an other task.

Stéphane Wirtel

6/14/2007 4:02:00 PM

Hi all,

I try to call a task of a namespace from an other task !

Exemple:

ReleaseDirectory = File.join( "d:", "release" )

namespace :release do
task :create do
mkdir_p ReleaseDirectory, QUIET
end
end

namespace :kernel do
task :compile do
end

task :release => [ ???? ] do
end
end


"????" What can I put ? I would like to use the task ":create" of the
namespace ":release". Is there a way to resolve my problem ?

Thanks

Stephane Wirtel

3 Answers

Stéphane Wirtel

6/14/2007 4:11:00 PM

0

Ok, I found a solution but I don't know if it's a good solution.

I put the namespace :release in a variable.

Example:

releaseNs = namespace :release do
task :create do
mkdir_p ReleaseDirectory
end
end

namespace :kernel do
task :compile do
end

task :release => [ releaseNs[:create] ] do
end
end


What do you think of this solution ?

Bob Showalter

6/14/2007 6:10:00 PM

0

On 6/14/07, Stéphane Wirtel <stephane.wirtel@gmail.com> wrote:
> Hi all,
>
> I try to call a task of a namespace from an other task !

Well, you're not strictly "calling" the task. You're making it a dependency

Stephane Wirtel

6/15/2007 6:53:00 AM

0

Bob Showalter a écrit :
> On 6/14/07, Stéphane Wirtel <stephane.wirtel@gmail.com> wrote:
>> Hi all,
>>
>> I try to call a task of a namespace from an other task !
>
> Well, you're not strictly "calling" the task. You're making it a dependency
yes, sorry.

a dependency.

Do you think that my previous mail is a good solution ?