Module: SevenZipRuby

Defined in:
lib/seven_zip_ruby.rb,
lib/seven_zip_ruby/version.rb,
lib/seven_zip_ruby/exception.rb,
lib/seven_zip_ruby/entry_info.rb,
lib/seven_zip_ruby/update_info.rb,
lib/seven_zip_ruby/archive_info.rb,
lib/seven_zip_ruby/seven_zip_reader.rb,
lib/seven_zip_ruby/seven_zip_writer.rb,
ext/seven_zip_ruby/seven_zip_archive.cpp

Defined Under Namespace

Classes: ArchiveInfo, EntryInfo, InvalidArchive, InvalidOperation, SevenZipReader, SevenZipWriter, UpdateInfo

Constant Summary collapse

EXTERNAL_LIB_DIR =
self.find_external_lib_dir.encode(Encoding::UTF_8)
VERSION =
"1.3.0"
Reader =

Reader is an alias of SevenZipReader.

SevenZipReader
Writer =

Writer is an alias of SevenZipWriter.

SevenZipWriter

Class Method Summary collapse

Class Method Details

.find_external_lib_dirObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/seven_zip_ruby.rb', line 6

def self.find_external_lib_dir
  external_lib = (RUBY_PLATFORM.downcase.match(/mswin|mingw/) ? "7z.dll" : "7z.so")
  dir = $LOAD_PATH.find do |i|
    path = File.expand_path(File.join(i, "seven_zip_ruby", external_lib))
    next File.file?(path)
  end
  raise "Failed to find 7z.dll or 7z.so" unless dir

  return File.join(dir, "seven_zip_ruby")
end