Sha256: 70925305ce398ee47f96b2800ed1bce154fd472c1e19045b14979c000ce12ba0
Contents?: true
Size: 989 Bytes
Versions: 8
Compression:
Stored size: 989 Bytes
Contents
require 'rubygems' require 'ffi_yajl/encoder' require 'ffi_yajl/parser' require 'ffi' require 'libyajl2' begin require 'fiddle' rescue LoadError end module FFI_Yajl # FIXME: DRY with ffi_yajl/ffi.rb libname = ::FFI.map_library_name("yajl") libpath = File.expand_path(File.join(Libyajl2.opt_path, libname)) libpath.gsub!(/dylib/, 'bundle') libpath = ::FFI.map_library_name("yajl") unless File.exist?(libpath) if defined?(Fiddle) && Fiddle.respond_to?(:dlopen) ::Fiddle.dlopen(libpath) else # deliberately convoluted delayed require here to avoid deprecation # warning from requiring dl require 'dl' if defined?(DL) && DL.respond_to?(:dlopen) ::DL.dlopen(libpath) else raise "cannot find dlopen in either DL or Fiddle, cannot proceed" end end class Parser require 'ffi_yajl/ext/parser' include FFI_Yajl::Ext::Parser end class Encoder require 'ffi_yajl/ext/encoder' include FFI_Yajl::Ext::Encoder end end
Version data entries
8 entries across 8 versions & 1 rubygems