Files
news.gitea.happylizard.me/bin/gems/ffi-1.17.1-x86_64-linux-gnu/lib/ffi.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

28 lines
834 B
Ruby

if RUBY_ENGINE == 'ruby'
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, 2, 20]) >= 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