From: Joel VanderWerf Date: 2006-04-26T14:18:49+09:00 Subject: Re: Rake task dependeny vs. method call Joel VanderWerf wrote: > ara.t.howard@noaa.gov wrote: >> On Wed, 26 Apr 2006, Trans wrote: >> >>> Just for fun I put together this simple demonstration. >> check out tsort. you need it to work if you have a diamond like >> >> b => a >> c => a >> d => b >> d => c >> >> else you'll run 'a' twice. tsort let's you build a dag of dependancies and >> even detects cycles. >> >> cheers. >> >> >> -a > > He (OP) already did the t-sort, implicitly. > > Here's a slightly modified version of T's code (#cache happens to be the > name of #memoize in my libs). The output is: It does the right thing on cycles, too: task :a => :b do puts "a" end task :b => :c do puts "b" end task :c => :a do puts "c" end Output: c b a -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407