Skip to content

Just an example code, running C code inside Ruby, studying FFI

Notifications You must be signed in to change notification settings

wevtimoteo/ruby-ffi-examples

Repository files navigation

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

About

Just an example code, running C code inside Ruby, studying FFI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published