Skip to content

Instantly share code, notes, and snippets.

@DouglasAllen
Created February 26, 2012 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DouglasAllen/1911968 to your computer and use it in GitHub Desktop.
Save DouglasAllen/1911968 to your computer and use it in GitHub Desktop.
an example for using inline gem
#!/usr/bin/env ruby
#note: do not use *.rb for shell execution. Copy and rename to "ruby_inline_c".
require 'rubygems'
require 'inline'
class Example
inline(:C) do |builder|
builder.c "int method_test1() {
int x = 10;
return x;
}"
end
end
p Example.new.method_test1
@DouglasAllen
Copy link
Author

I am very much interested in using ruby extensions in my code because I want to learn how to access
my alsa for my debian system. Could I use Timidity libs as well? I want to get some midi tunes running
live using ruby.
Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment