Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <ruby.h>
RUBY_GLOBAL_SETUP;
int main(int argc,char *argv[]){
VALUE obj;
VALUE result;
VALUE map;
ruby_sysinit(&argc, &argv);
RUBY_INIT_STACK;
ruby_init();
ruby_init_loadpath();
rb_require("./func.rb");
obj=rb_str_new_cstr("");
map = rb_hash_new();
rb_hash_aset(map, rb_str_new2("key"),rb_str_new2("val"));
result = rb_funcall(obj, rb_intern("func"), 1, map);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment