Sha256: 163aa3c9a72e10c8067998a57bef306bd89c23016dafa6f7c8068abe5e691729

Contents?: true

Size: 575 Bytes

Versions: 2

Compression:

Stored size: 575 Bytes

Contents

# frozen_string_literal: true

require 'ffi'

module Nt
  # Fingerprint converts queries to fingerprints.
  module Fingerprint
    extend FFI::Library

    platform = `uname -sm`

    file = case platform
           when /^Linux.*64/
             'libfp-linux-amd64.so'
           when /^Darwin.*64/
             'libfp-darwin-10.6-amd64.dylib'
           else
             abort 'nt-fingerprint does not support your platform.'
           end

    ffi_lib File.expand_path("../../../go/build/#{file}", __dir__)
    attach_function :fingerprint, [:string], :string
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nt-fingerprint-0.1.1 lib/nt/fingerprint/fingerprint.rb
nt-fingerprint-0.1.0 lib/nt/fingerprint/fingerprint.rb