Method: Zip::ZipFile.foreach

Defined in:
lib/zip/zip.rb

.foreach(aZipFileName, &block) ⇒ Object

Iterates over the contents of the ZipFile. This is more efficient than using a ZipInputStream since this methods simply iterates through the entries in the central directory structure in the archive whereas ZipInputStream jumps through the entire archive accessing the local entry headers (which contain the same information as the central directory).



1405
1406
1407
1408
1409
1410
# File 'lib/zip/zip.rb', line 1405

def ZipFile.foreach(aZipFileName, &block)
  ZipFile.open(aZipFileName) {
	|zipFile|
	zipFile.each(&block)
  }
end