Class: Excavate::Extractors::XzExtractor

Inherits:
Extractor
  • Object
show all
Defined in:
lib/excavate/extractors/xz_extractor.rb

Overview

Extractor for XZ compressed archives (both .xz and .tar.xz formats)

This extractor handles:

  • Pure XZ compressed files (.xz)

  • Compound TAR+XZ archives (.tar.xz)

Uses libarchive through ffi-libarchive-binary for extraction, which provides native XZ decompression support.

Examples:

Extract a .tar.xz file

extractor = XzExtractor.new("archive.tar.xz")
extractor.extract("/target/directory")

Extract a pure .xz file

extractor = XzExtractor.new("file.xz")
extractor.extract("/target/directory")

Instance Method Summary collapse

Methods inherited from Extractor

#initialize

Constructor Details

This class inherits a constructor from Excavate::Extractors::Extractor

Instance Method Details

#extract(target) ⇒ void

This method returns an undefined value.

Extract the XZ archive to the specified target directory

Parameters:

  • target (String)

    the directory path where files should be extracted

Raises:

  • (StandardError)

    if extraction fails



28
29
30
# File 'lib/excavate/extractors/xz_extractor.rb', line 28

def extract(target)
  extract_with_libarchive(target)
end