module Archive

Constants

COMPRESSION_BZIP2
COMPRESSION_COMPRESS
COMPRESSION_GRZIP
COMPRESSION_GZIP
COMPRESSION_LRZIP
COMPRESSION_LZ4
COMPRESSION_LZIP
COMPRESSION_LZMA
COMPRESSION_LZOP
COMPRESSION_NONE
COMPRESSION_PROGRAM
COMPRESSION_RPM
COMPRESSION_UU
COMPRESSION_XZ
EXTRACT_ACL
EXTRACT_CLEAR_NOCHANGE_FFLAGS
EXTRACT_FFLAGS
EXTRACT_HFS_COMPRESSION_FORCED
EXTRACT_MAC_METADATA
EXTRACT_NO_AUTODIR
EXTRACT_NO_HFS_COMPRESSION
EXTRACT_NO_OVERWRITE
EXTRACT_NO_OVERWRITE_NEWER
EXTRACT_OWNER
EXTRACT_PERM
EXTRACT_SECURE_NOABSOLUTEPATHS
EXTRACT_SECURE_NODOTDOT
EXTRACT_SPARSE
EXTRACT_TIME
EXTRACT_XATTR
FORMAT_7ZIP
FORMAT_AR
FORMAT_AR_BSD
FORMAT_AR_GNU
FORMAT_BASE_MASK
FORMAT_CAB
FORMAT_CPIO
FORMAT_CPIO_BIN_BE
FORMAT_CPIO_BIN_LE
FORMAT_CPIO_POSIX
FORMAT_CPIO_SVR4_CRC
FORMAT_CPIO_SVR4_NOCRC
FORMAT_EMPTY
FORMAT_ISO9660
FORMAT_ISO9660_ROCKRIDGE
FORMAT_LHA
FORMAT_MTREE
FORMAT_RAR
FORMAT_RAW
FORMAT_SHAR
FORMAT_SHAR_BASE
FORMAT_SHAR_DUMP
FORMAT_TAR
FORMAT_TAR_GNUTAR
FORMAT_TAR_PAX_INTERCHANGE
FORMAT_TAR_PAX_RESTRICTED
FORMAT_TAR_USTAR
FORMAT_WARC
FORMAT_XAR
FORMAT_ZIP
VERSION

Public Class Methods

libpath(*args) { || ... } click to toggle source

Returns the library path for the module. If any arguments are given, they will be joined to the end of the libray path using File.join.

# File lib/ffi-libarchive.rb, line 11
def self.libpath(*args)
  rv = args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
  if block_given?
    begin
      $LOAD_PATH.unshift LIBPATH
      rv = yield
    ensure
      $LOAD_PATH.shift
    end
  end
  rv
end
path(*args) { || ... } click to toggle source

Returns the lpath for the module. If any arguments are given, they will be joined to the end of the path using File.join.

# File lib/ffi-libarchive.rb, line 28
def self.path(*args)
  rv = args.empty? ? PATH : ::File.join(PATH, args.flatten)
  if block_given?
    begin
      $LOAD_PATH.unshift PATH
      rv = yield
    ensure
      $LOAD_PATH.shift
    end
  end
  rv
end
read_open_filename(file_name, command = nil, &block) click to toggle source
# File lib/ffi-libarchive/archive.rb, line 283
def self.read_open_filename(file_name, command = nil, &block)
  Reader.open_filename file_name, command, &block
end
read_open_memory(string, command = nil, &block) click to toggle source
# File lib/ffi-libarchive/archive.rb, line 287
def self.read_open_memory(string, command = nil, &block)
  Reader.open_memory string, command, &block
end
read_open_stream(reader, &block) click to toggle source
# File lib/ffi-libarchive/archive.rb, line 291
def self.read_open_stream(reader, &block)
  Reader.open_stream reader, &block
end
require_all_libs_relative_to(fname, dir = nil) click to toggle source

Utility method used to require all files ending in .rb that lie in the directory below this file that has the same name as the filename passed in. Optionally, a specific directory name can be passed in such that the filename does not have to be equivalent to the directory.

# File lib/ffi-libarchive.rb, line 46
def self.require_all_libs_relative_to(fname, dir = nil)
  dir ||= ::File.basename(fname, ".*")
  search_me = ::File.expand_path(
    ::File.join(::File.dirname(fname), dir, "**", "*.rb")
  )

  Dir.glob(search_me).sort.each { |rb| require rb }
end
version_number() click to toggle source
# File lib/ffi-libarchive/archive.rb, line 303
def self.version_number
  C.archive_version_number
end
version_string() click to toggle source
# File lib/ffi-libarchive/archive.rb, line 307
def self.version_string
  C.archive_version_string
end
write_open_filename(file_name, compression, format, &block) click to toggle source
# File lib/ffi-libarchive/archive.rb, line 295
def self.write_open_filename(file_name, compression, format, &block)
  Writer.open_filename file_name, compression, format, &block
end
write_open_memory(string, compression, format, &block) click to toggle source
# File lib/ffi-libarchive/archive.rb, line 299
def self.write_open_memory(string, compression, format, &block)
  Writer.open_memory string, compression, format, &block
end