[Rake-devel] List of Files as prerequisits

Emanuel Indermühle e.i at bluewin.ch
Tue Jul 31 07:20:21 EDT 2007


I have a question concerning the use of rake. Sorry for using dhe
developper mailing list, but there was no other.

How do i make a task that has as prerequisit a list of files.
As this is the nature of tasks their requisits may be missing.

So i cant make a FileList of files that are missing.

There is a list of these files, stored in a other file (its name ist

But this file will be created by another task. How do i implement this
problem in rake. 

My try:

--------code ------------

def methodToGetFileListFromlettersFile (path,extension = "")
    hmms = []
    File.open("system/system/letter.txt", "r") do |file|
        file.each_line do | line |
            hmms << path + line + extension
    return hmms

rule ".hmm" do | t | 
    `touch #{t.name}`
    #is in reality more complex

file "letter.txt" do
     #generate "letter.txt" somehow

task :combineFiles=>["letter.txt"]+methodToGetFileListFromletterFile("systempath/","hmm")
    #do something with the files


But then i realized that when the task are created the file letter.txt
is not existing so methodToGetFileListFromlettersFile() will fail.

What is a possible solution for my problem

Thanks for every answer

More information about the Rake-devel mailing list