Module: SeleniumPrep::System::Extract

Extended by:
Extract
Included in:
Extract
Defined in:
lib/selenium-prep/system/extract.rb

Instance Method Summary collapse

Instance Method Details

#delete_zip_filesObject



22
23
24
25
26
# File 'lib/selenium-prep/system/extract.rb', line 22

def delete_zip_files
  puts 'Deleting zip files...'
  zip_files.each { |zip_file| delete_file zip_file }
  puts 'Done working with zip files.'
end

#extract_zip_filesObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/selenium-prep/system/extract.rb', line 9

def extract_zip_files
  puts "Extracting zip files..."
  zip_files.each do |file|
    Zip::File.open(file, 'wb') do |zip_file|
      zip_file.each do |f|
        f_path = File.join(ENV['SE_DOWNLOAD_LOCATION'], f.name)
        delete_file f_path if File.exist? f_path
        zip_file.extract(f, f_path)
      end
    end
  end
end