Sha256: 5e3b33fd69fe349728435164c700eb067673261514087510ea7a391580aefadd

Contents?: true

Size: 562 Bytes

Versions: 1

Compression:

Stored size: 562 Bytes

Contents

require 'zip/zip'

module Selenium
  module WebDriver
    module ZipHelper

      def self.unzip(path)
        destination = Dir.mktmpdir("unzip")
        FileReaper << destination

        Zip::ZipFile.open(path) do |zip|
          zip.each do |entry|
            to      = File.join(destination, entry.name)
            dirname = File.dirname(to)

            FileUtils.mkdir_p dirname unless File.exist? dirname
            zip.extract(entry, to)
          end
        end

        destination
      end


    end # ZipHelper
  end # WebDriver
end # Selenium

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
selenium-webdriver-0.0.28 lib/selenium/webdriver/zip_helper.rb