Sha256: bf153a22036f452f157d31ec9c2edb00e4284f62c33b1e9c5fcf1ee4d187b4fa

Contents?: true

Size: 578 Bytes

Versions: 10

Compression:

Stored size: 578 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

10 entries across 10 versions & 1 rubygems

Version Path
ffi-libarchive-binary-0.2.2 lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.2-x86_64-linux lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.2-x86_64-darwin lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.2-x86-linux lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.2-arm64-darwin lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.1 lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.1-x86_64-linux lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.1-x86_64-darwin lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.1-x86-linux lib/ffi-libarchive-binary.rb
ffi-libarchive-binary-0.2.1-arm64-darwin lib/ffi-libarchive-binary.rb