lib/unzipper.rb
# Returns the extracted contents in an array.
Returns the extracted contents in an array.
Returns the extracted contents in an array .
def extract_to_memory(zip_path, save_path)
    files_to_delete = []
    extracted_files = []
    Zip::File.open(zip_path) do |zip_file|
      zip_file.each do |file|
        files_to_delete.push("#{save_path}#{file}")
        extract_to_file(zip_file, file, "#{save_path}#{file}")
        extracted_files.push(File.open("#{save_path}#{file}", 'rb').read)
      end
    end
    delete_old_files(save_path, files_to_delete, extracted_files)
  end
def extract_to_memory ( zip_path , save_path ) files_to_delete = [ ] extracted_files = [ ] Zip :: File . open ( zip_path ) do | zip_file | zip_file . each do | file | files_to_delete . push ( "#{save_path}#{file}" ) extract_to_file ( zip_file , file , "#{save_path}#{file}" ) extracted_files . push ( File . open ( "#{save_path}#{file}" , 'rb' ) . read ) end end delete_old_files ( save_path , files_to_delete , extracted_files ) end
Returns the extracted contents in an array.
Returns the extracted contents in an array .
zip_path
<not_specific>
save_path
<not_specific>