Ruby tries to load the library named
string relative to the requiring file’s path. If the file’s
path cannot be determined a LoadError is
raised. If a file is loaded true is returned and false otherwise.
VALUE
rb_f_require_relative(VALUE obj, VALUE fname)
{
VALUE base = rb_current_realfilepath();
if (NIL_P(base)) {
rb_loaderror("cannot infer basepath");
}
base = rb_file_dirname(base);
return rb_require_safe(rb_file_absolute_path(fname, base), rb_safe_level());
}