Sha256: 9044cf2bbd186ca635881fd8cc0b4be377d06b6cbce43901fabf2746bd2aceae

Contents?: true

Size: 908 Bytes

Versions: 22

Compression:

Stored size: 908 Bytes

Contents

if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
  Object.send(:remove_const, :FFI) if defined?(::FFI)
  begin
    require RUBY_VERSION.split('.')[0, 2].join('.') + '/ffi_c'
  rescue Exception
    require 'ffi_c'
  end

  require 'ffi/ffi'

elsif RUBY_ENGINE == 'jruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [9, 3]) >= 0
  JRuby::Util.load_ext("org.jruby.ext.ffi.FFIService")
  require 'ffi/ffi'

elsif RUBY_ENGINE == 'truffleruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [20, 1, 0]) >= 0
  require 'truffleruby/ffi_backend'
  require 'ffi/ffi'

else
  # Remove the ffi gem dir from the load path, then reload the internal ffi implementation
  $LOAD_PATH.delete(File.dirname(__FILE__))
  $LOAD_PATH.delete(File.join(File.dirname(__FILE__), 'ffi'))
  unless $LOADED_FEATURES.nil?
    $LOADED_FEATURES.delete(__FILE__)
    $LOADED_FEATURES.delete('ffi.rb')
  end
  require 'ffi.rb'
end

Version data entries

22 entries across 21 versions & 5 rubygems

Version Path
cloudsmith-api-0.57.1 vendor/bundle/ruby/2.6.0/gems/ffi-1.15.0/lib/ffi.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/ffi-1.15.0/lib/ffi.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/ffi-1.14.2/lib/ffi.rb
mfk_openapi_ruby_client-1.0.0 vendor/bundle/ruby/2.7.0/gems/ffi-1.14.2/lib/ffi.rb
ffi-1.15.0 lib/ffi.rb
ffi-1.15.0-java lib/ffi.rb
ffi-1.15.0-x64-mingw32 lib/ffi.rb
ffi-1.15.0-x86-mingw32 lib/ffi.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/ffi-1.14.2-java/lib/ffi.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/ffi-1.14.2/lib/ffi.rb
ffi-1.14.2-java lib/ffi.rb
ffi-1.14.2-x86-mingw32 lib/ffi.rb
ffi-1.14.2-x64-mingw32 lib/ffi.rb
ffi-1.14.2 lib/ffi.rb
ffi-1.14.1-x64-mingw32 lib/ffi.rb
ffi-1.14.1-x86-mingw32 lib/ffi.rb
ffi-1.14.1-java lib/ffi.rb
ffi-1.14.1 lib/ffi.rb
ffi-1.14.0-x64-mingw32 lib/ffi.rb
ffi-1.14.0-x86-mingw32 lib/ffi.rb