[Rake-devel] Custom Task

Jim Weirich jim at weirichhouse.org
Mon Aug 8 07:59:47 EDT 2005


On Monday 08 August 2005 03:02 am, Charles F. I. Savage wrote:
> I could do:
>
> download 'http://www.somesite.com/path/myfile.tar.gz' do |task|
>     move 'myfile.tar.gz' '/usr/src/'
> end

I see a couple of options.  One is to do:

 download 'http://www.somesite.com/path/myfile.tar.gz' do |task|
     cp 'myfile.tar.gz' '/usr/src/'
 end

Then the downloaded file won't disappear.

Another option is to make the download function sensitive to the final 
directory, e.g.

  download 'http://www.somesite.com/path/myfile.tar.gz', '/usr/src'

Omitting the second argument would default to your current behavior.


-- 
-- Jim Weirich    jim at weirichhouse.org     http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct, 
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)


More information about the Rake-devel mailing list