From 5c8edab967093118ceb6ac5e7a288c76875cbd25 Mon Sep 17 00:00:00 2001 From: ktsj Date: Thu, 4 May 2017 08:58:59 +0000 Subject: [PATCH] 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- dir.c | 8 ++++---- 1 file 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 enc argument specifies the encoding of the directory. + * The optional encoding 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 enc argument specifies the encoding of the directory. + * The optional encoding keyword argument specifies the encoding of the directory. * If not specified, the filesystem encoding is used. * * With no block, open is a synonym for @@ -2510,8 +2510,8 @@ dir_foreach(int argc, VALUE *argv, VALUE io) * directory. Will raise a SystemCallError if the named * directory doesn't exist. * - * The optional enc argument specifies the encoding of the directory. - * If not specified, the filesystem encoding is used. + * The optional encoding keyword argument specifies the encoding of the + * directory. If not specified, the filesystem encoding is used. * * Dir.entries("testdir") #=> [".", "..", "config.h", "main.rb"] *