Sha256: dc687acd4095e70acf06b304b8e040afd3c3f62ee2436b660c59dc330e1e1309
Contents?: true
Size: 729 Bytes
Versions: 21
Compression:
Stored size: 729 Bytes
Contents
require 'rbconfig' # Utility to load native binaries on Java CLASSPATH class NativeFolder attr_reader :os, :bit WIN_FORMAT = 'windows%d'.freeze LINUX_FORMAT = 'linux%d'.freeze # WIN_PATTERNS = [ # /bccwin/i, # /cygwin/i, # /djgpp/i, # /ming/i, # /mswin/i, # /wince/i # ].freeze def initialize @os = RbConfig::CONFIG['host_os'].downcase @bit = java.lang.System.get_property('os.arch') =~ /64/ ? 64 : 32 end def name return 'macosx' if os =~ /darwin/ || os =~ /mac/ # return format(WIN_FORMAT, bit) if WIN_PATTERNS.include? os return format(LINUX_FORMAT, bit) if os =~ /linux/ end def extension return '*.so' if os =~ /linux/ '*.dylib' # MacOS end end
Version data entries
21 entries across 21 versions & 1 rubygems