Class: Downlow::Zip

Inherits:
Extractor show all
Defined in:
lib/downlow/extractors/zip.rb

Instance Attribute Summary

Attributes inherited from Extractor

#destination, #final_path, #options, #path, #tmp_dir

Instance Method Summary collapse

Methods inherited from Extractor

extract, #extracted?, extractor_for, handles, #initialize

Constructor Details

This class inherits a constructor from Downlow::Extractor

Instance Method Details

#extractObject



8
9
10
11
12
13
14
15
# File 'lib/downlow/extractors/zip.rb', line 8

def extract
  ::Zip::ZipFile.foreach(path) do |file|
    path = destination + file.name
    path.dirname.mkpath
    file.extract(path)
  end
  @final_path = destination
end