Sha256: 30fe8306dd38d055c6aed94f383e87f1517e483976ae91a7f0a7cd834b20353f

Contents?: true

Size: 603 Bytes

Versions: 4

Compression:

Stored size: 603 Bytes

Contents

# frozen_string_literal: true

require "ffi-libarchive-binary/version"
require "ffi"
require "pathname"

module LibarchiveBinary
  class Error < StandardError; end

  module LibraryPath
    LIBRARY_PATH = Pathname.new(File.join(__dir__, "ffi-libarchive-binary"))

    def ffi_lib(*names)
      prefixed = names.map do |name|
        paths = name.is_a?(Array) ? name : [name]
        paths.map { |x| LIBRARY_PATH.join(FFI::map_library_name(x)).to_s }
      end

      super(*(prefixed + names))
    end
  end

  ::FFI::Library.prepend(LibraryPath)
  require "ffi-libarchive"
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ffi-libarchive-binary-0.2.2-x86-mingw32 lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.2-x64-mingw32 lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.1-x86-mingw32 lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.1-x64-mingw32 lib/ffi-libarchive-binary.rb