summaryrefslogtreecommitdiff
path: root/lib/ffi_yajl/ext.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ffi_yajl/ext.rb')
-rw-r--r--lib/ffi_yajl/ext.rb14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/ffi_yajl/ext.rb b/lib/ffi_yajl/ext.rb
index 5784023..bc4d410 100644
--- a/lib/ffi_yajl/ext.rb
+++ b/lib/ffi_yajl/ext.rb
@@ -2,22 +2,14 @@ require 'rubygems'
require 'ffi_yajl/encoder'
require 'ffi_yajl/parser'
-require 'ffi'
require 'libyajl2'
-require 'ffi_yajl/platform'
+require 'ffi_yajl/map_library_name'
module FFI_Yajl
- extend FFI_Yajl::Platform
+ extend FFI_Yajl::MapLibraryName
- # FIXME: DRY with ffi_yajl/ffi.rb
- # FIXME: extract map_library_name from FFI and stop requiring it at the top level
- # so that the C-library can be installed without FFI
- libname = ::FFI.map_library_name("yajl")
- # awful windows patch, but there is an open issue to entirely replace FFI.map_library_name already
- libname = "libyajl.so" if windows?
+ libname = map_library_name
libpath = File.expand_path(File.join(Libyajl2.opt_path, libname))
- libpath.gsub!(/dylib/, 'bundle')
- libpath = ::FFI.map_library_name("yajl") unless File.exist?(libpath)
#
# FFS, what exactly was so wrong with DL.dlopen that ruby had to get rid of it???