FAQ Purpose Frequently asked questions about Excavate.
General Questions What is Excavate? Excavate is a Ruby library for extracting archives across multiple formats. It provides a unified interface for ZIP, TAR, CAB, MSI, RPM, 7-Zip, and other formats.
Is Excavate pure Ruby? Yes. Excavate is 100% pure Ruby with no native dependencies. It works on MRI, JRuby, and TruffleRuby.
ZIP, TAR, TAR.GZ, TAR.XZ, 7-Zip, CAB, MSI, RPM, PKG/XAR, CPIO, GZIP, and XZ.
How is Excavate different from other archive libraries? Excavate focuses on extraction and provides:
Installation What Ruby versions are supported? Ruby 2.7 or later. Works on MRI, JRuby, and TruffleRuby.
What are the dependencies? All dependencies are pure Ruby:
omnizip (~> 0.3.8)
cabriolet (~> 0.2.2)
thor (~> 1.0)
How do I install Excavate? Usage Excavate :: Archive . new ( 'file.zip' ). extract Use recursive_packages: true:
Excavate :: Archive . new ( 'installer.msi' ). extract ( recursive_packages: true ) Excavate :: Archive . new ( 'data.zip' ). extract ( files: [ 'config.json' ]) Excavate :: Archive . new ( 'fonts.zip' ). extract ( filter: '**/*.ttf' ) Troubleshooting Why am I getting "Target exists" error? The target directory already exists. Either:
Why am I getting "Unknown archive" error? The file format is not recognized. Check:
If using recursive extraction, nested archives are replaced with their contents. The original archive files are removed.
Does Excavate work on Windows? Yes. Excavate handles Windows-specific issues like file locking.
Does Excavate work on macOS? Yes. PKG/XAR format is fully supported.
Does Excavate work on Linux? Yes. RPM and TAR formats are fully supported.
Integration Can I use Excavate with Rails? Yes. Excavate works with Rails uploaded files:
archive = Excavate :: Archive . new ( params [ :file ])
archive . extract ( target , recursive_packages: true ) Yes. Use the files method:
archive . files do | path |
# Process file
end More Questions For additional questions: