Larry Fast wrote: > What I find myself writing in Rake is the following: > > task xyz => ['abc?'] do > enc > > # test before proceeding > task abc? do > if !abc > exit > end > end > > What I'm creating is failable dependencies. XYZ should not be executed > unless abc succeeds. Unfortunately the structure I've shown stops on > the first failure. What I'd like to do is report all failures but only > execute if everything passes. > > This could be implemented by processing prerequisites until a prereq > returns false. Any task containing any false prereqs would not be > processed. > > Does this exist anywhere? It's not directly supported by Rake. The way I think I would approach this is to let each of the prerequisites vote on whether the xyz task should run or not. The prereqs would register the voting with in some central location (e.g. a global or maybe some central voting object). I would then write the xyz task like this: task :xyz => [:abc?, :acb?] do if XYZ_SHOULD_RUN.ok? do_xyz_stuff end end This way all the prerequisites get a chance to run and the xyz task is responsible for detecting the vote. -- Jim Weirich -- Posted via http://www.ruby-forum.com/.