From: Niklas Frykholm Date: 2005-09-05T21:44:27+09:00 Subject: Re: Rake: multiple prerequisites in rule? Martin Honermeyer wrote: >desc "Make ERB templates from Kwartz html and plogic files" >SRC = FileList['app/views/**/*.html'] >OBJ = SRC.ext('rhtml') >task :templates => [OBJ] > >rule '.rhtml' => ['.html'] do |t| > sh "kwartz -Rails -e -p #{t.source.ext('plogic')} --extract=content >#{t.source} > #{t.name}" >end > >This works. The problem is that the .rhtml is only regenerated when >the .html changes. I tried adding the .plogic file as another prerequisite: > >rule '.rhtml' => ['.html', '.plogic'] do |t| > >That makes Rake say > >Too many dependents specified in rule .rhtml: [".html", ".plogic"] > >Apparently, it's not possible to have multiple prerequisites for a rule. >Does anyone have a hint on this? > Not as elegant as using a rule perhaps, but you could write SRC.each {|src| rhtml = src.ext('rhtml') plogic = src.ext('plogic') file src => [rhtml, plogic] do |t| // Niklas