Clarify documentation of Kernel#require_relative

This commit is contained in:
Benoit Daloze 2022-06-21 18:40:28 +02:00
parent 2e81fd764b
commit 1f067e775d

7
load.c
View File

@ -945,9 +945,10 @@ rb_f_require(VALUE obj, VALUE fname)
* call-seq: * call-seq:
* require_relative(string) -> true or false * require_relative(string) -> true or false
* *
* Ruby tries to load the library named _string_ relative to the requiring * Ruby tries to load the library named _string_ relative to the directory
* file's path. If the file's path cannot be determined a LoadError is raised. * containing the requiring file. If the file does not exist a LoadError is
* If a file is loaded +true+ is returned and false otherwise. * raised. Returns +true+ if the file was loaded and +false+ if the file was
* already loaded before.
*/ */
VALUE VALUE
rb_f_require_relative(VALUE obj, VALUE fname) rb_f_require_relative(VALUE obj, VALUE fname)