Method: Zip::ZipFile.open

Defined in:
lib/pik/contrib/zip/zip.rb

.open(fileName, create = nil) ⇒ Object

Same as #new. If a block is passed the ZipFile object is passed to the block and is automatically closed afterwards just as with ruby’s builtin File.open method.



1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
# File 'lib/pik/contrib/zip/zip.rb', line 1377

def ZipFile.open(fileName, create = nil)
  zf = ZipFile.new(fileName, create)
  if block_given?
	begin
	  yield zf
	ensure
	  zf.close
	end
  else
	zf
  end
end