Class: Bio::Faster::Library

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/faster/library.rb

Class Method Summary collapse

Class Method Details

.lib_extensionObject



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

.loadString

Note:

this method is called automatically when the module is loaded

Load the correct library for the OS system in use

Returns:

  • (String)

    the absolute path for the filename of the shared library



18
19
20
21
22
# File 'lib/bio/faster/library.rb', line 18

def self.load
  path = File.expand_path File.dirname(__FILE__)
  path.gsub!(/lib\/bio\/faster/,'ext')
  File.join(path,"libfaster.#{self.lib_extension}")
end