[前][次][番号順一覧][スレッド一覧]

ruby-changes:46451

From: ktsj <ko1@a...>
Date: Thu, 4 May 2017 17:59:04 +0900 (JST)
Subject: [ruby-changes:46451] ktsj:r58566 (trunk): dir.c: [DOC] Properly refer to keyword argument by its name [Fix GH-1543]

ktsj	2017-05-04 17:58:59 +0900 (Thu, 04 May 2017)

  New Revision: 58566

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58566

  Log:
    dir.c: [DOC] Properly refer to keyword argument by its name [Fix GH-1543]
    
    enc is the name of the variable used in the example, not the name of the
    keyword argument (encoding).
    
    The documentation used to wrongly suggest that the keyword argument name was
    "enc" which could cause people try try to call `Dir.open("thing", enc: "utf-8")`
    
    Author: Olivier Lacan <hi@o...>

  Modified files:
    trunk/dir.c
Index: dir.c
===================================================================
--- dir.c	(revision 58565)
+++ dir.c	(revision 58566)
@@ -484,7 +484,7 @@ dir_s_alloc(VALUE klass) https://github.com/ruby/ruby/blob/trunk/dir.c#L484
  *
  *  Returns a new directory object for the named directory.
  *
- *  The optional <i>enc</i> argument specifies the encoding of the directory.
+ *  The optional <i>encoding</i> keyword argument specifies the encoding of the directory.
  *  If not specified, the filesystem encoding is used.
  */
 static VALUE
@@ -555,7 +555,7 @@ dir_initialize(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/dir.c#L555
  *     Dir.open( string ) {| aDir | block } -> anObject
  *     Dir.open( string, encoding: enc ) {| aDir | block } -> anObject
  *
- *  The optional <i>enc</i> argument specifies the encoding of the directory.
+ *  The optional <i>encoding</i> keyword argument specifies the encoding of the directory.
  *  If not specified, the filesystem encoding is used.
  *
  *  With no block, <code>open</code> is a synonym for
@@ -2510,8 +2510,8 @@ dir_foreach(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/dir.c#L2510
  *  directory. Will raise a <code>SystemCallError</code> if the named
  *  directory doesn't exist.
  *
- *  The optional <i>enc</i> argument specifies the encoding of the directory.
- *  If not specified, the filesystem encoding is used.
+ *  The optional <i>encoding</i> keyword argument specifies the encoding of the
+ *  directory. If not specified, the filesystem encoding is used.
  *
  *     Dir.entries("testdir")   #=> [".", "..", "config.h", "main.rb"]
  *

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]