I wrote:
> ... As you can see, I had
> to tweak Task#invoke to allow them to be called repeatedly.
I just noticed that this is handy for other things, like:
namespace :db do
desc 'Delete all tables, and migrate DB to latest version.'
task :reload do
ENV['VERSION'] = '0'
Rake::Task['db:migrate'].invoke
ENV.delete 'VERSION'
Rake::Task['db:migrate'].invoke false
end
end
...which is not possible with the current invoke method.
So, independent from the Observer Mode patch, it would be nice to have
this in Rake 0.8 :)
Actually, it might be preferable to change the semantics of #invoke to
skip the only-once check by default, and check only if the option "true"
is given. If rake is started from the shell, it would act as usual, but
if you use it manually (like in the above example), you would get the
expected result (two invocations), without a parameter.
Alternatively, an invoke_once method might be even better.
[murphy]
_______________________________________________
Rake-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rake-devel