require 'fiddle'
require 'rbconfig'

ext = RbConfig::CONFIG['DLEXT'] == 'bundle' ? 'dylib' : RbConfig::CONFIG['DLEXT']
basename = "librusty_blank.#{ext}"
library = Fiddle.dlopen(File.join(File.dirname(__FILE__), basename))
func = Fiddle::Function.new(library['init_rusty_blank'],
                            [], Fiddle::TYPE_VOIDP)
func.call

require 'fiddle'
require 'rbconfig'
require 'thermite/config'

libdir = File.dirname(__FILE__)
library_name = Thermite::Config.new(cargo_project_path: File.dirname(libdir)).shared_library
library = Fiddle.dlopen(File.join(libdir, library_name))
func = Fiddle::Function.new(library['init_rusty_blank'],
                            [], Fiddle::TYPE_VOIDP)
func.call

Use Thermite::Config to load the library via Fiddle in a cross-platform way
Use Thermite::Config to load the library via Fiddle in a cross-platform way
