VALUE rb_require_safe(VALUE fname, int safe) { FilePathValue(fname); // Immediately, check out if we have an AOT feature for this. if (rb_vm_aot_feature_load(RSTRING_PTR(fname))) { rb_provide_feature(fname); return Qtrue; } #if MACRUBY_STATIC rb_raise(rb_eRuntimeError, "#require is not supported in MacRuby static"); #else VALUE result = Qnil; VALUE path; int type = 0; if (search_required(fname, &path, &type)) { if (path == 0) { result = Qfalse; } else { rb_set_safe_level_force(0); rb_provide_feature(path); switch (type) { case TYPE_RB: rb_rescue2(load_try, path, load_rescue, path, rb_eException, 0); break; case TYPE_RBO: dln_load(RSTRING_PTR(path), false); break; case TYPE_BUNDLE: dln_load(RSTRING_PTR(path), true); break; default: abort(); } result = Qtrue; } } if (NIL_P(result)) { load_failed(fname); } return result; #endif }
static VALUE load_ext(VALUE path) { rb_scope_visibility_set(METHOD_VISI_PUBLIC); return (VALUE)dln_load(RSTRING_PTR(path)); }
static VALUE load_ext(VALUE path) { SCOPE_SET(NOEX_PUBLIC); return (VALUE)dln_load(RSTRING_PTR(path)); }