Nuby Rake questions about FileList or File task

Hello all,

It was recommended that I post rake questions here. I couldn’t find a
rake specific mail list. If there is one, please point me to it.

I am creating a rake script and my .Net app test projects have
app.config.template files that I want to rename to app.config but only
if app.config doesn’t already exist.

So, I am doing the following:

        FileList['**/app.config.template'].each do |src|

                                cp src,

“#{File.dirname(src)}/app.config” unless
File::exist?("#{File.dirname(src)}/app.config")

                    end

It does work… but seems like I should be able to do this with a rule or
File task… but I can’t figure out how. Should I just stick with the
above?

Also, what is the order that stuff that is in the rakefile but not in a
task will run. If I want this to happen no matter what task is run
should I put it before any tasks, or does it not matter? Or, should I
really put the above into my compile task?

Finally, I am confused about a File task. Does this run all the time, or
does it need to be called?

Thanks,

BOb