Module: Erebus::Actions::ZipFile
- Included in:
- SetupTest
- Defined in:
- lib/erebus/actions/zip_file.rb
Instance Method Summary collapse
Instance Method Details
#extract(source_file, destination) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/erebus/actions/zip_file.rb', line 6 def extract source_file, destination Zip::ZipFile.open(source_file) do |zip_file| zip_file.each do |f| f_path=File.join(destination, f.name) FileUtils.mkdir_p(File.dirname(f_path)) zip_file.extract(f, f_path) unless File.exist?(f_path) end end end |