aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authorktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-04 08:58:59 +0000
committerktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-04 08:58:59 +0000
commiteef90cb37ed6fdb804eb1927697b41fd35d6ea7a (patch)
tree7ad690e8de51e65b602c430195499488dd203fbf /dir.c
parenta16444946cb1fdd1cccdb069384a1bd01be2d1f7 (diff)
downloadruby-eef90cb37ed6fdb804eb1927697b41fd35d6ea7a.tar.gz
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@olivierlacan.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/dir.c b/dir.c
index e3099f4973..e568ab000d 100644
--- a/dir.c
+++ b/dir.c
@@ -484,7 +484,7 @@ dir_s_alloc(VALUE klass)
*
* 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, VALUE dir)
* 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 io)
* 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"]
*