mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
file.c: [DOC] separators at dirname and basename
* file.c (rb_file_s_basename, rb_file_s_dirname): [DOC] state that trailing separators will be stripped first, like as basename(1) and dirname(1). [ruby-core:82828] [Bug #13908] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
65055fe244
commit
40d117ae88
1 changed files with 6 additions and 4 deletions
10
file.c
10
file.c
|
@ -4121,7 +4121,8 @@ ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encodin
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* File.basename(file_name [, suffix] ) -> base_name
|
* File.basename(file_name [, suffix] ) -> base_name
|
||||||
*
|
*
|
||||||
* Returns the last component of the filename given in <i>file_name</i>,
|
* Returns the last component of the filename given in
|
||||||
|
* <i>file_name</i> (after first stripping trailing separators),
|
||||||
* which can be formed using both <code>File::SEPARATOR</code> and
|
* which can be formed using both <code>File::SEPARATOR</code> and
|
||||||
* <code>File::ALT_SEPARATOR</code> as the separator when
|
* <code>File::ALT_SEPARATOR</code> as the separator when
|
||||||
* <code>File::ALT_SEPARATOR</code> is not <code>nil</code>. If
|
* <code>File::ALT_SEPARATOR</code> is not <code>nil</code>. If
|
||||||
|
@ -4184,9 +4185,10 @@ rb_file_s_basename(int argc, VALUE *argv)
|
||||||
* File.dirname(file_name) -> dir_name
|
* File.dirname(file_name) -> dir_name
|
||||||
*
|
*
|
||||||
* Returns all components of the filename given in <i>file_name</i>
|
* Returns all components of the filename given in <i>file_name</i>
|
||||||
* except the last one. The filename can be formed using both
|
* except the last one (after first stripping trailing separators).
|
||||||
* <code>File::SEPARATOR</code> and <code>File::ALT_SEPARATOR</code> as the
|
* The filename can be formed using both <code>File::SEPARATOR</code>
|
||||||
* separator when <code>File::ALT_SEPARATOR</code> is not <code>nil</code>.
|
* and <code>File::ALT_SEPARATOR</code> as the separator when
|
||||||
|
* <code>File::ALT_SEPARATOR</code> is not <code>nil</code>.
|
||||||
*
|
*
|
||||||
* File.dirname("/home/gumby/work/ruby.rb") #=> "/home/gumby/work"
|
* File.dirname("/home/gumby/work/ruby.rb") #=> "/home/gumby/work"
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue