Skip to content

Instantly share code, notes, and snippets.

@dchentech
Created February 25, 2011 09:49
Show Gist options
  • Save dchentech/843595 to your computer and use it in GitHub Desktop.
Save dchentech/843595 to your computer and use it in GitHub Desktop.
Makefile
*bundle
*o
require 'mkmf'
extension_name = 'MacRuby'
dir_config(extension_name)
create_makefile(extension_name)
#include "ruby.h"
VALUE MacRuby = Qnil;
void Init_MacRuby();
VALUE version(VALUE self);
void Init_MacRuby() {
MacRuby = rb_define_class("MacRuby", rb_cObject);
rb_define_singleton_method(MacRuby, "version", version, 0);
}
VALUE version(VALUE self) {
return INT2NUM(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment