Class: Bio::Faster::Library
- Inherits:
-
Object
- Object
- Bio::Faster::Library
- Defined in:
- lib/bio/faster/library.rb
Class Method Summary collapse
- .lib_extension ⇒ Object
-
.load ⇒ String
Load the correct library for the OS system in use.
Class Method Details
.lib_extension ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/bio/faster/library.rb', line 7 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 ⇒ String
Note:
this method is called automatically when the module is loaded
Load the correct library for the OS system in use
18 19 20 21 22 |
# File 'lib/bio/faster/library.rb', line 18 def self.load path = File. File.dirname(__FILE__) path.gsub!(/lib\/bio\/faster/,'ext') File.join(path,"libfaster.#{self.lib_extension}") end |