List Info

Thread: How to use a rule for this?




How to use a rule for this?
user name
2006-05-22 13:07:24
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
_______________________________________________
Rake-devel mailing list
Rake-develrubyforge.org
http
://rubyforge.org/mailman/listinfo/rake-devel
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )