1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Document require_relative

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2010-12-25 02:07:13 +00:00
parent 91c6ba2333
commit d0830a222c
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Sat Dec 25 11:06:00 2010 Eric Hodel <drbrain@segment7.net>
* load.c (rb_f_require_relative): Add documentation.
Sat Dec 25 11:02:52 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/zlib/zlib.c (gzreader_gets): support optional length

10
load.c
View file

@ -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);