Class: Inspec::Archive::ZipArchiveGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/inspec/archive/zip.rb

Instance Method Summary collapse

Instance Method Details

#archive(base_dir, files, archive) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/inspec/archive/zip.rb', line 7

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