Skip to content

Instantly share code, notes, and snippets.

@wolfedale

wolfedale/.rb Secret

Created January 15, 2016 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wolfedale/fc4da012b1b037381734 to your computer and use it in GitHub Desktop.
Save wolfedale/fc4da012b1b037381734 to your computer and use it in GitHub Desktop.
unzip
def un_zip(file, type)
begin
Zip.on_exists_proc = true
Zip::File.open(file) do |zip_file|
zip_file.each do |f|
f_path = File.join(@rand_dir, f.name)
FileUtils.mkdir_p(File.dirname(f_path))
zip_file.extract(f, f_path)
queue(f_path, type?(f_path).chomp)
end
end
rescue
Logs.instance.log(Time.now, @queue_num, "Probably password protected.")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment