Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 714 Bytes

README.md

File metadata and controls

49 lines (33 loc) · 714 Bytes

Ruby FFI Examples

Native way

Just following post How to create a Ruby extension in C under 5 minutes.

Compiling

Generate a Makefile:

ruby extconf.rb

Now compile that C extension:

make

Running

If you want to run an example:

ruby test.rb

Using RubyInline gem

Testing RubyInline things go faster, test it by running:

bundle install
ruby rubyinline_example.rb

Using FFI gem

Testing FFI:

bundle install
ruby ffi_example.rb