Sha256: 662103ddbf23110e405199fc11dd863f68befd14f269cdeb33699b7e5d99b713
Contents?: true
Size: 708 Bytes
Versions: 2
Compression:
Stored size: 708 Bytes
Contents
# Utility to load native binaries on Java CLASSPATH #HACK until jruby returns a more specific 'host_os' than 'linux' class NativeFolder attr_reader :os, :bit LINUX_FORMAT = 'linux%s'.freeze ARM32 = '-armv6hf'.freeze ARM64 = '-aarch64'.freeze def initialize @os = java.lang.System.get_property('os.name') @bit = java.lang.System.get_property('os.arch') end def name if /linux/.match?(os) return format(LINUX_FORMAT, '64') if /amd64/.match?(bit) return format(LINUX_FORMAT, ARM32) if /arm/.match?(bit) return format(LINUX_FORMAT, ARM64) if /aarch/.match?(bit) end raise RuntimeError, "Unsupported Architecture" end def extension '*.so' end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
picrate-2.4.0-java | lib/picrate/native_folder.rb |
picrate-2.3.0-java | lib/picrate/native_folder.rb |