diff --git a/ChangeLog b/ChangeLog index a610161939..3f2f1a0e09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Dec 25 11:06:00 2010 Eric Hodel + + * load.c (rb_f_require_relative): Add documentation. + Sat Dec 25 11:02:52 2010 Nobuyoshi Nakada * ext/zlib/zlib.c (gzreader_gets): support optional length diff --git a/load.c b/load.c index 7f23183c1f..2628b31c12 100644 --- a/load.c +++ b/load.c @@ -453,7 +453,15 @@ rb_f_require(VALUE obj, VALUE fname) return rb_require_safe(fname, rb_safe_level()); } -VALUE +/* + * call-seq: + * require_relative(string) -> true or false + * + * 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. + */ + rb_f_require_relative(VALUE obj, VALUE fname) { VALUE rb_current_realfilepath(void);