Sha256: f632fc563c2178b911b22da5dc4147ecd57b04c7d5f36304e887d70fab8b9c90

Contents?: true

Size: 601 Bytes

Versions: 1

Compression:

Stored size: 601 Bytes

Contents

# dependencies
require "ffi"

# modules
require "libmf/model"
require "libmf/version"

module Libmf
  class Error < StandardError; end

  class << self
    attr_accessor :ffi_lib
  end
  lib_name =
    if Gem.win_platform?
      "mf.dll"
    elsif RbConfig::CONFIG["host_os"] =~ /darwin/i
      if RbConfig::CONFIG["host_cpu"] =~ /arm/i
        "libmf.arm64.dylib"
      else
        "libmf.dylib"
      end
    else
      "libmf.so"
    end
  vendor_lib = File.expand_path("../vendor/#{lib_name}", __dir__)
  self.ffi_lib = [vendor_lib]

  # friendlier error message
  autoload :FFI, "libmf/ffi"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
libmf-0.2.2 lib/libmf.rb