ruby-changes:18319
From: drbrain <ko1@a...>
Date: Sat, 25 Dec 2010 11:07:22 +0900 (JST)
Subject: [ruby-changes:18319] Ruby:r30342 (trunk): Document require_relative
drbrain 2010-12-25 11:07:13 +0900 (Sat, 25 Dec 2010) New Revision: 30342 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30342 Log: Document require_relative Modified files: trunk/ChangeLog trunk/load.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30341) +++ ChangeLog (revision 30342) @@ -1,3 +1,7 @@ +Sat Dec 25 11:06:00 2010 Eric Hodel <drbrain@s...> + + * load.c (rb_f_require_relative): Add documentation. + Sat Dec 25 11:02:52 2010 Nobuyoshi Nakada <nobu@r...> * ext/zlib/zlib.c (gzreader_gets): support optional length Index: load.c =================================================================== --- load.c (revision 30341) +++ load.c (revision 30342) @@ -453,7 +453,15 @@ 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/