lib/fig/os.rb
# Expects files_to_archive as an Array of filenames.
Expects files_to_archive as an Array of filenames.
Expects files_to_archive as an Array of filenames .
def create_archive(archive_name, files_to_archive)
      ::Archive.write_open_filename(archive_name, ::Archive::COMPRESSION_GZIP, ::Archive::FORMAT_TAR) do |ar|
        files_to_archive.each do |fn|
          ar.new_entry do |entry|
            entry.copy_stat(fn)
            entry.pathname = fn
            ar.write_header(entry)
            if !entry.directory?
              ar.write_data(open(fn) {|f| f.binmode; f.read })
            end
          end
        end
      end
    end
def create_archive ( archive_name , files_to_archive ) :: Archive . write_open_filename ( archive_name , :: Archive :: COMPRESSION_GZIP , :: Archive :: FORMAT_TAR ) do | ar | files_to_archive . each do | fn | ar . new_entry do | entry | entry . copy_stat ( fn ) entry . pathname = fn ar . write_header ( entry ) if ! entry . directory? ar . write_data ( open ( fn ) { | f | f . binmode ; f . read } ) end end end end end
Expects files_to_archive as an Array of filenames.
Expects files_to_archive as an Array of filenames .
# TODO: Need to verify files_to_archive exists.
archive_name
files_to_archive