Class: ZipList

Inherits:
Object show all
Defined in:
lib/zip/ziprequire.rb

Instance Method Summary collapse

Constructor Details

#initialize(zipFileList) ⇒ ZipList

Returns a new instance of ZipList.



4
5
6
# File 'lib/zip/ziprequire.rb', line 4

def initialize(zipFileList)
    @zipFileList = zipFileList
end

Instance Method Details

#get_input_stream(entry, &aProc) ⇒ Object

Raises:

  • (Errno::ENOENT)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/zip/ziprequire.rb', line 8

def get_input_stream(entry, &aProc)
  @zipFileList.each {
    |zfName|
    Zip::ZipFile.open(zfName) {
	|zf|
	begin
 return zf.get_input_stream(entry, &aProc) 
	rescue Errno::ENOENT
	end
    }
  }
  raise Errno::ENOENT,
    "No matching entry found in zip files '#{@zipFileList.join(', ')}' "+
    " for '#{entry}'"
end