Method: Selenium::WebDriver::Zipper.zip
- Defined in:
- lib/selenium/webdriver/common/zipper.rb
permalink .zip(path) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/selenium/webdriver/common/zipper.rb', line 52 def zip(path) with_tmp_zip do |zip| ::Find.find(path) do |file| add_zip_entry zip, file, file.sub("#{path}/", '') unless File.directory?(file) end zip.commit File.open(zip.name, 'rb') { |io| Base64.strict_encode64 io.read } end end |