Can not Rake :), please help

Hi, I dont get what is wrong with this rakefile:

#====================================
task :default => :TTList

checkfile = “arrangement0/list.txt”
task :TTList => checkfile do
regenarate
end
#===================================

So, regenarate function regenarates bunch of files, including the
checkfile. When I call rake, it should run :TTList task, but only if
checkfile is not there. This rakefile runs :TTList even if the
checkfile exists.

thx.

On 6/17/07, ozizus [email protected] wrote:

#===================================

So, regenarate function regenarates bunch of files, including the
checkfile. When I call rake, it should run :TTList task, but only if
checkfile is not there. This rakefile runs :TTList even if the
checkfile exists.

I think you probably want:

task :default => checkfile

checkfile = “arrangement0/list.txt”
file checkfile do
regenarate
end

AFAIK tasks are more like functions, dependent on other tasks, which
must be
done first. ‘file’ creates a file task, which will run in order to
create
that target (checkfile).
If you want checkfile to be dependant on other files:

file checkfile => [depfile1, depfile2] do
regenarate
end

For more info, go through the tutorial:
http://onestepback.org/articles/buildingwithrake/filetasks.html

PS: regenerate, not regenarate

Les

thx.

On 6/17/07, ozizus [email protected] wrote:

So, regenarate function regenarates bunch of files, including the
checkfile. When I call rake, it should run :TTList task, but only if
checkfile is not there. This rakefile runs :TTList even if the
checkfile exists.

If I recall correctly, it works the other way around. You’re defining
the checkfile as a pre-requisite of TTList, so it would only run if
the checkfile was already present. If you remove it, does TTList run?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs