List Info

Thread: expose ruby_init_gems() in for Ruby 1.9




expose ruby_init_gems() in <ruby.h> for Ruby 1.9
country flaguser name
United States
2008-03-29 12:34:25
Hello,

Please expose ruby_init_gems() in <ruby.h> to allow
proper embedding
of the Ruby 1.9 interpreter.

At present, I'm having to mimic the implementation of
ruby_init_gems() manually in my C program:

void the_c_program()
{
    RUBY_INIT_STACK;
    ruby_init();
    ruby_init_loadpath();

    //////////////////////////////////////////
    // mimic the call to ruby_init_gems(Qtrue)
    //////////////////////////////////////////

    rb_const_set(rb_define_module("Gem"),
        rb_intern("Enable"), Qtrue);

    Init_prelude();

    //////////////////////////////////////////

    rb_require("redcloth"); // require a gem

    //...

    ruby_finalize();
}

Without this code, I am unable to require() any gems.  If
ruby_init_gems() were exposed in ruby.h, then I could simply
call it
directly instead of "re-inventing the wheel" (at
the risk of my
re-invention drifting away from future changes to
ruby_init_gems()
as time goes on).

Thanks for your consideration.



[1]

about | contact  Other archives ( Real Estate discussion Medical topics )