Memoize the block around the system call

http://6brand.com/ruby-speedup-memoize-those-methods.html

On Dec 2, 2009, at 5:24 AM, Robin Bowes <[email protected]>  
wrote:

> Hi,
>
> I'm using railsless deploy, and have this task to generate a config  
> file
> locally, and copy it to all hosts:
>
>    desc <<-DESC
>        Create config file & copy to release path
>    DESC
>    task :create_copy_config_file, :roles => [:web] do
>        print "    Creating config file.\n"
>        file = 'files/counter.php'
>        system "scripts/create_config #{file}"
>        print "    Copying config file.\n"
>        upload(file, "#{release_path}/www/counter.php")
>    end
>
> I suspect that will re-create the config file once for every host?
>
> If so, how would I just generate the config file once locally, then  
> copy
> to all hosts?
>
> It's not so bad for this simple case but I have another task to write
> that grabs ~200M of GeoIP updates and I only want to execute that  
> once!
>
> R.
>
> -- 
> * You received this message because you are subscribed to the Google  
> Groups "Capistrano" group.
> * To post to this group, send email to [email protected]
> * To unsubscribe from this group, send email to 
> [email protected] 
>  For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to