Watson1978
7/4/2011 - 5:30 PM

gistfile1.txt

$ gcc main.m -framework Foundation -framework MacRuby -fobjc-gc
$ ./a.out            
Fixnum
42
#import <Foundation/Foundation.h>
#import <MacRuby/MacRuby.h>

int main(void) {
  id ruby;

  ruby = [[MacRuby sharedRuntime] evaluateFileAtPath:@"test.rb"];

  NSNumber *num = [NSNumber numberWithInt: 42];
  [ruby performRubySelector:@selector(main:) withArguments: (id)num, NULL];
  return 0;
}
def main(num)
  p num.class
  puts num
end