Method: Zip::ZipFile#add

Defined in:
lib/pik/contrib/zip/zip.rb

#add(entry, srcPath, &continueOnExistsProc) ⇒ Object

Convenience method for adding the contents of a file to the archive



1438
1439
1440
1441
1442
1443
1444
# File 'lib/pik/contrib/zip/zip.rb', line 1438

def add(entry, srcPath, &continueOnExistsProc)
  continueOnExistsProc ||= proc { false }
  check_entry_exists(entry, continueOnExistsProc, "add")
  newEntry = entry.kind_of?(ZipEntry) ? entry : ZipEntry.new(@name, entry.to_s)
  newEntry.gather_fileinfo_from_srcpath(srcPath)
  @entrySet << newEntry
end