Sha256: 50f2243418a36f24ed58a98c314838dab618c95d29e4e09da7faac664adb0999

Contents?: true

Size: 664 Bytes

Versions: 12

Compression:

Stored size: 664 Bytes

Contents

module PodPrebuild
  module ZipUtils
    def self.zip(path, to_dir: nil, name: nil)
      basename = File.basename(path)
      toname = name.nil? ? basename : name
      unless to_dir.nil? 
        FileUtils.mkdir_p(to_dir)
      end
      
      out_path = to_dir.nil? ? "#{toname}.zip" : "#{to_dir}/#{toname}.zip"
      cmd = []
      cmd << "cd" << File.dirname(path)
      cmd << "&& zip -r --symlinks" << out_path << basename
      cmd << "&& cd -"
      `#{cmd.join(" ")}`
    end

    def self.unzip(path, to_dir: nil)
      cmd = []
      cmd << "unzip -nq" << path
      cmd << "-d" << to_dir unless to_dir.nil?
      `#{cmd.join(" ")}`
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cocoapods-binary-artifactory-cache-0.0.12 lib/command/helper/zip.rb
cocoapods-binary-artifactory-cache-0.0.11 lib/command/helper/zip.rb
cocoapods-binary-artifactory-cache-0.0.10 lib/command/helper/zip.rb
cocoapods-binary-artifactory-cache-0.0.9 lib/command/helper/zip.rb
cocoapods-binary-artifactory-cache-0.0.8 lib/command/helper/zip.rb
cocoapods-binary-artifactory-cache-0.0.7 lib/command/helper/zip.rb
cocoapods-binary-artifactory-cache-0.0.6 lib/command/helper/zip.rb
cocoapods-binary-artifactory-cache-0.0.5 lib/command/helper/zip.rb
cocoapods-binary-artifactory-cache-0.0.4 lib/command/helper/zip.rb
cocoapods-binary-artifactory-cache-0.0.3 lib/command/helper/zip.rb
cocoapods-binary-artifactory-cache-0.0.2 lib/command/helper/zip.rb
cocoapods-binary-artifactory-cache-0.0.1 lib/command/helper/zip.rb