Beispiel #1
0
int
ruby_require_internal(const char *fname, unsigned int len)
{
    struct RString fake;
    VALUE str = rb_setup_fake_str(&fake, fname, len, 0);
    int result = rb_require_internal(str, 0);
    rb_set_errinfo(Qnil);
    return result == TAG_RETURN ? 1 : result ? -1 : 0;
}
Beispiel #2
0
int
ruby_require_internal(const char *fname, unsigned int len)
{
    struct RString fake;
    VALUE str = rb_setup_fake_str(&fake, fname, len, 0);
    int result = rb_require_internal(str, 0);
    if (result > 1) result = -1;
    rb_set_errinfo(Qnil);
    return result;
}