From: Edwin Fine Date: 2006-12-08T14:50:19+09:00 Subject: Re: rescue and continue on next statement ? Eric Hodel wrote: > On Dec 7, 2006, at 04:10 , Zouplaz wrote: > >> Hello, I've seen there is a retry statement that rerun the entire >> begin/end block which raised the exception... >> >> I wonder if there is a way to 'continue' (from the rescue block) >> with the next statement following the one which raised the exception. > > File.delete "#{@fichier_destination_sql}.gz" rescue nil > File.delete "#{@fichier_destination_tar}.tgz" rescue nil > File.delete "/tmp/aboulafia-db-testdb_rbackup-uid1.gz" rescue nil > File.delete "/tmp/aboulafia-rep-ror_anaema-uid1.tgz" rescue nil > > > -- > Eric Hodel - drbrain@segment7.net - http://blog.segment7.net > > I LIT YOUR GEM ON FIRE! Hmmm... is it just because this is an example that the code is repeated? If not, how about something like %W[#{@fichier_destination_sql}.gz #{@fichier_destination_tar}.tgz /tmp/aboulafia-db-testdb_rbackup-uid1.gz" /tmp/aboulafia-rep-ror_anaema-uid1.tgz].each do |f| File.delete(f) rescue nil end -- Posted via http://www.ruby-forum.com/.