andy
3/28/2008 6:27:00 PM
Ryan Davis wrote:
>
> On Mar 26, 2008, at 16:55 , Andy Koch wrote:
>> I've made a rake task that I'm running from my rails, and it works -
>> but only once. If I then restart the server (mongrel) it works again
>> - once.
>>
>> I can simulate this in the console session as shown...
>>
>> q = Rake::Task["cache_sweeper"]
>> => <Rake::Task cache_sweeper => []>
>> >> q.invoke
>> =>
>> [#<Proc:0xb6d03444@./script/../config/../config/../lib/tasks/cache.rake:4>]
>>
>> >> q = Rake::Task["cache_sweeper"]
>> => <Rake::Task cache_sweeper => []>
>> >> q.invoke
>> => nil
>> >>
>>
>>
>> ... when q.invoke returns the "[#Proc:..." it has worked correctly,
>> nil means nothing happened.
>>
>> Any one have insight to what is happening with rake?
>
> It is doing it's job. Rake runs tasks once by definition. It is a build
> tool. That is what it is for.
>
>
>
>
ah, so my usage is incorrect - that's what I was suspecting
Thanks for confirming my suspicions