/* * Compile this using something like the following: * gcc -Wall -o myprog -static exerb.c -lruby -lm -lcrypt \ * -L/usr/local/lib/ruby/1.6/i386-freebsd4.6 \ * -I/usr/local/lib/ruby/1.6/i386-freebsd4.6 * See: http://www.rubycentral.com/book/ext_ruby.html * and main.c from the ruby distribution */ static char *prog=" puts \"hello, world!\\n\"; puts \"the end\\n\"; "; #include "ruby.h" int main(int argc, char *argv[]) { ruby_init(); /* ruby_options(argc, argv); waits until EOF on stdin? */ ruby_script("exerb"); rb_eval_string(prog); return 0; }