Method: AsProject::RemoteFileLoader#unpack_zip

Defined in:
lib/tasks/remote_file_loader.rb

#unpack_zip(zip_file, dir) ⇒ Object



61
62
63
64
65
66
67
68
69
# File 'lib/tasks/remote_file_loader.rb', line 61

def unpack_zip(zip_file, dir)
  Zip::ZipFile::open(zip_file) do |zf|
     zf.each do |e|
       fpath = File.join(dir, e.name)
       FileUtils.mkdir_p(File.dirname(fpath))
       zf.extract(e, fpath)
     end
   end
end