Joel VanderWerf wrote:
> Jim Weirich wrote:
>> The problem is that a plain string in the *rule* dependency list already 
>> has a meaning: it is the file extension to be used in the name of the 
>> source file for the target.
> 
> That's what I was guessing. I'll stick with procs, as you suggest below:
> 
>> You can do this:
>>
>> generic_files = FileList["foo", "bar", "baz"].collect { |fn| lambda { fn 
>> } }
> 
> Thanks!
> 

On second thought... would it be possible for the proc to *return* a
FileList? It doesn't seem to work now, but it would be a nice feature,
wouldn't it?

$ cat rakefile
generic_files = proc {FileList["foo", "bar", "baz"]}

rule /^site_\w+/ => [
  proc {|fn| "__#{fn}"},
  generic_files
] do |t|
  p t.name
end

task :__site_stuff

file "foo" do touch "foo"; end
file "bar" do touch "bar"; end
file "baz" do touch "baz"; end

$ rake site_stuff
(in /home/vjoel/ruby/misc/rake)
rake aborted!
can't convert Rake::FileList into String

(See full trace by running task with --trace)
$

-- 
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407