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



11
12
13
14
15
16
17
# File 'lib/inspec/archive/zip.rb', line 11

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