Sha256: 11e22420d8ce4d043b3bc03bda2ea490bae6de430759442ead6dadffdce899fa
Contents?: true
Size: 746 Bytes
Versions: 4
Compression:
Stored size: 746 Bytes
Contents
# stdlib require "fiddle/import" require "fileutils" require "tempfile" # modules require "thundersvm/model" require "thundersvm/classifier" require "thundersvm/regressor" require "thundersvm/version" module ThunderSVM class Error < StandardError; end class << self attr_accessor :ffi_lib end lib_name = if Gem.win_platform? "thundersvm.dll" elsif RbConfig::CONFIG["host_os"] =~ /darwin/i "libthundersvm.dylib" else "libthundersvm.so" end vendor_lib = File.expand_path("../vendor/#{lib_name}", __dir__) self.ffi_lib = [vendor_lib] # friendlier error message autoload :FFI, "thundersvm/ffi" def self.load_model(path) model = Model.new model.load_model(path) model end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
thundersvm-0.1.4 | lib/thundersvm.rb |
thundersvm-0.1.3 | lib/thundersvm.rb |
thundersvm-0.1.2 | lib/thundersvm.rb |
thundersvm-0.1.1 | lib/thundersvm.rb |