class BetterSam::Library
Public Class Methods
lib_extension()
click to toggle source
# File lib/bettersam/library.rb, line 6 def self.lib_extension case RbConfig::CONFIG['host_os'] when /linux/ then return 'so' when /darwin/ then return 'dylib' else raise NotImplementedError, "Native library is not available for Windows platform" end end
load()
click to toggle source
Load the correct library for the OS system in use @return [String] the absolute path for the filename of the shared library @note this method is called automatically when the module is loaded
# File lib/bettersam/library.rb, line 18 def self.load path = File.expand_path File.dirname(__FILE__) path.gsub!(/lib\/bettersam/,'ext') File.join(path,"libbettersam.#{self.lib_extension}") end