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).
1399 1400 1401 1402 1403 1404 |
# File 'lib/zip/zip.rb', line 1399 def ZipFile.foreach(aZipFileName, &block) ZipFile.open(aZipFileName) { |zipFile| zipFile.each(&block) } end |