lib/zipr/archive.rb
def add(source_folder, files_to_add: nil)
      files_to_add = determine_files_to_add(source_folder, files_to_check: files_to_add)
      FileUtils.mkdir_p(::File.dirname(@path)) unless ::File.directory?(::File.dirname(@path))

      case @options[:archive_type]
      when :zip
        _add_to_zip(source_folder, files_to_add)
      when :seven_zip
        _add_to_seven_zip(source_folder, files_to_add)
      else
        raise "':#{@options[:archive_type]}' is not a supported archive type!"
      end
      raise "Failed to create archive at #{@path}!" unless ::File.file?(@path)
      EasyIO.logger.info "Archiving to #{::File.basename(@path)} finished." unless @options[:silent]
      archive_checksums = @options[:sfx] ? @checksums : update_checksum_file # Don't update the checksum file yet if it's an SFX
      [@checksum_path, archive_checksums]
    end
#
# Description:
#   Add files to an existing archive or create one if it does not exist
# Returns:
#   Array of 2 objects: String path to the checksum file and the hash of known checksums for archive files.
# Parameters:
#   source_folder: The path from which relative archive paths will be derived.
#   files_to_add: An array of files to be added to the archive. Relative or full paths accepted. If omitted, takes all files and folders in the source_folder.
Add files to an existing archive or create one if it does not exist
Returns:
Array of 2 objects: String path to the checksum file and the hash of known checksums for archive files.
Parameters:
source_folder: The path from which relative archive paths will be derived.
files_to_add: An array of files to be added to the archive. Relative or full paths accepted. If omitted, takes all files and folders in the source_folder.
Add files to an existing archive or create one if it does not exist Returns : Array of 2 objects : String path to the checksum file and the hash of known checksums for archive files . Parameters : source_folder : The path from which relative archive paths will be derived . files_to_add : An array of files to be added to the archive . Relative or full paths accepted . If omitted takes all files and folders in the source_folder .
def add(source_folder, files_to_add: nil)
      files_to_add = determine_files_to_add(source_folder, files_to_check: files_to_add)
      FileUtils.mkdir_p(::File.dirname(@path)) unless ::File.directory?(::File.dirname(@path))
      case @options[:archive_type]
      when :zip
        _add_to_zip(source_folder, files_to_add)
      when :seven_zip
        _add_to_seven_zip(source_folder, files_to_add)
      else
        raise "':#{@options[:archive_type]}' is not a supported archive type!"
      end
      raise "Failed to create archive at #{@path}!" unless ::File.file?(@path)
      EasyIO.logger.info "Archiving to #{::File.basename(@path)} finished." unless @options[:silent]
      archive_checksums = @options[:sfx] ? @checksums : update_checksum_file 
      [@checksum_path, archive_checksums]
    end
def add ( source_folder , files_to_add : nil ) files_to_add = determine_files_to_add ( source_folder , files_to_check : files_to_add ) FileUtils . mkdir_p ( :: File . dirname ( @path ) ) unless :: File . directory? ( :: File . dirname ( @path ) ) case @options [ :archive_type ] when :zip _add_to_zip ( source_folder , files_to_add ) when :seven_zip _add_to_seven_zip ( source_folder , files_to_add ) else raise "':#{@options[:archive_type]}' is not a supported archive type!" end raise "Failed to create archive at #{@path}!" unless :: File . file? ( @path ) EasyIO . logger . info "Archiving to #{::File.basename(@path)} finished." unless @options [ :silent ] archive_checksums = @options [ :sfx ] ? @checksums : update_checksum_file [ @checksum_path , archive_checksums ] end
Description:
Add files to an existing archive or create one if it does not exist
Returns:
Array of 2 objects: String path to the checksum file and the hash of known checksums for archive files.
Description : Add files to an existing archive or create one if it does not exist Returns : Array of 2 objects : String path to the checksum file and the hash of known checksums for archive files .
# Don't update the checksum file yet if it's an SFX
source_folder
files_to_add