Created
October 13, 2015 15:08
-
-
Save xarimanx/f4293403ffc7da374e91 to your computer and use it in GitHub Desktop.
extract zip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Zip::ZipFile.open(file_path) do |zip_file| | |
zip_file.each do |f| | |
f_path=File.join("destination_path", f.name) | |
FileUtils.mkdir_p(File.dirname(f_path)) | |
zip_file.extract(f, f_path) unless File.exist?(f_path) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment