module PodPrebuild::ZipUtils

Public Class Methods

unzip(path, to_dir: nil) click to toggle source
# File lib/command/helper/zip.rb, line 13
def self.unzip(path, to_dir: nil)
  cmd = []
  cmd << "unzip -q" << path
  cmd << "-d" << to_dir unless to_dir.nil?
  `#{cmd.join(" ")}`
end
zip(path, to_dir: nil) click to toggle source
# File lib/command/helper/zip.rb, line 3
def self.zip(path, to_dir: nil)
  basename = File.basename(path)
  out_path = to_dir.nil? ? "#{basename}.zip" : "#{to_dir}/#{basename}.zip"
  cmd = []
  cmd << "cd" << File.dirname(path)
  cmd << "&& zip -r --symlinks" << out_path << basename
  cmd << "&& cd -"
  `#{cmd.join(" ")}`
end