diff options
author | tduehr <tduehr@gmail.com> | 2015-05-26 08:26:25 -0500 |
---|---|---|
committer | tduehr <tduehr@gmail.com> | 2015-05-26 08:26:59 -0500 |
commit | 83c53aa8d51a24f6f7e2f866eeb1649484f57a22 (patch) | |
tree | 08ac15cd56170d4016bf3c9ea9c0ccc13169f240 /lib | |
parent | 4c64e84418c2f268b4967dc8c3f03876e1bfa88e (diff) | |
download | ffi-83c53aa8d51a24f6f7e2f866eeb1649484f57a22.tar.gz |
fix library load... forever
thanks @davispuh
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ffi.rb | 14 |
1 files changed, 1 insertions, 13 deletions
@@ -1,19 +1,7 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx' Object.send(:remove_const, :FFI) if defined?(::FFI) begin - if RUBY_VERSION =~ /^1\.8/ - require '1.8/ffi_c' - elsif RUBY_VERSION =~ /^1\.9/ - require '1.9/ffi_c' - elsif RUBY_VERSION =~ /^2\.0/ - require '2.0/ffi_c' - elsif RUBY_VERSION =~ /^2\.1/ - require '2.1/ffi_c' - elsif RUBY_VERSION =~ /^2\.2/ - require '2.2/ffi_c' - else - require 'ffi_c' - end + require RUBY_VERSION.split('.')[0, 2].join('.') + '/ffi_c' rescue Exception require 'ffi_c' end |