[Rake-devel] Changing task dependencies from another task

Damphyr damphyr at freemail.gr
Thu Oct 6 08:24:32 EDT 2005


Jim Weirich wrote:
> On Wednesday 05 October 2005 11:25 am, Damphyr wrote:
> 
>>I thought this is a question better directed at the source instead of
>>ruby-talk :).
>>Now, I have a script that generates HTML from XML for part of a site.
>>I use tasks to get the files from the source control repository, copy
>>them to a directory that mirrors the structure of the actual site and
>>then I scp the files over.
> 
> 
> Hi,
> 
> I took a quick look at your rakefile, but had trouble reproducing the problem.  
> If you would like to send a small tar file with just enough files to allow me 
> to run the system, I would be glad to look into it further.   You don't have 
> to perform to real transform you are doing, just enough dependencies to 
> illustrate the problem.
> 
> Thanks.
> 
Well this is something I discussed with Stefan Lang (of Rant fame - I 
know, I'm shameless ;) ) on ruby-talk and he provided this:

$ cat Rakefile
     @print = lambda { |t| puts t.name }

     task :A => :B, &@print
     task :B do |t|
         file :A => [:C, :D]
         @print[t]
     end
     task :C, &@print
     task :D, &@print
     $ rake A
     (in /home/stefan/tmp/rant-dyn-dep.t)
     B
     A

The desired result would be
B
C
D
A

Cheers,
V.-
-- 
http://www.braveworld.net/riva

____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.


More information about the Rake-devel mailing list