Method: Fetchers::Zip#initialize

Defined in:
lib/fetchers/zip.rb

#initialize(target) ⇒ Zip

Returns a new instance of Zip.



21
22
23
24
25
26
27
28
29
30
# File 'lib/fetchers/zip.rb', line 21

def initialize(target)
  @target = target
  @contents = {}
  @files = []
  ::Zip::InputStream.open(@target) do |io|
    while (entry = io.get_next_entry)
      @files.push(entry.name.sub(%r{/+$}, ''))
    end
  end
end