File Manager

Path: /opt/chef/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.22.1/lib/inspec/archive/

Viewing File: zip.rb

require "rubygems"
require "zip"
require "pathname"

module Inspec::Archive
  class ZipArchiveGenerator
    def archive(base_dir, files, archive)
      Zip::File.open(archive, Zip::File::CREATE) do |zipfile|
        files.each do |input_filename|
          zipfile.add(input_filename, Pathname.new(base_dir).join(input_filename))
        end
      end
    end
  end
end