lib/ngt.rb in ngt-0.3.2 vs lib/ngt.rb in ngt-0.3.3

- old
+ new

@@ -14,10 +14,15 @@ class Error < StandardError; end class << self attr_accessor :ffi_lib end - lib_name = FFI.map_library_name("ngt") + lib_name = + if RbConfig::CONFIG["host_os"] =~ /darwin/i && RbConfig::CONFIG["host_cpu"] =~ /arm/i + FFI.map_library_name("ngt.arm64") + else + FFI.map_library_name("ngt") + end vendor_lib = File.expand_path("../vendor/#{lib_name}", __dir__) self.ffi_lib = [vendor_lib] # friendlier error message autoload :FFI, "ngt/ffi"