[Rake-devel] How to use a rule for this?

Peter Michaux petermichaux at gmail.com
Mon May 22 09:07:24 EDT 2006


Hi,

I'm just new to rake but have read the three hieraki books and some of
the online docs. It is great so far but I know I could be doing
better.

I have the following rake file. I think I could use a rule to stop
repeating myself too many "push 'first'" type of lines that may all
have to change at some point. The only rule example I could find was
with file extensions ".o" and ".c". Is there a way to write a rule for
this?

Thanks,
Peter

doodads = []

task :second => [:first] do
  doodads.push "second"
end

task :first do
  doodads.push "first"
end

task :third => [:first] do
  doodads.push "third"
end

task :fourth => [:second, :first] do
  doodads.push "fourth"
end


More information about the Rake-devel mailing list