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

ruby-changes:22197

From: akr <ko1@a...>
Date: Mon, 9 Jan 2012 20:28:52 +0900 (JST)
Subject: [ruby-changes:22197] akr:r34246 (trunk): * ext/pathname/pathname.c (path_entries): add document suggested by

akr	2012-01-09 20:28:00 +0900 (Mon, 09 Jan 2012)

  New Revision: 34246

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34246

  Log:
    * ext/pathname/pathname.c (path_entries): add document suggested by
      the thread [ruby-core:41959] [Bug #5859].

  Modified files:
    trunk/ChangeLog
    trunk/ext/pathname/pathname.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34245)
+++ ChangeLog	(revision 34246)
@@ -1,3 +1,8 @@
+Mon Jan  9 20:26:33 2012  Tanaka Akira  <akr@f...>
+
+	* ext/pathname/pathname.c (path_entries): add document suggested by
+	  the thread [ruby-core:41959] [Bug #5859].
+
 Mon Jan  9 20:14:13 2012  Tanaka Akira  <akr@f...>
 
 	* ext/socket/lib/socket.rb (family_addrinfo): don't require protocol
Index: ext/pathname/pathname.c
===================================================================
--- ext/pathname/pathname.c	(revision 34245)
+++ ext/pathname/pathname.c	(revision 34246)
@@ -861,8 +861,27 @@
  * Return the entries (files and subdirectories) in the directory, each as a
  * Pathname object.
  *
+ * The result contains just a filename which has no directory.
+ *
  * The result may contain the current directory #<Pathname:.> and the parent
  * directory #<Pathname:..>.
+ *
+ * If you don't want #<Pathname:.> and #<Pathname:..> and
+ * want directory, consider Pathname#children.
+ *
+ *   pp Pathname.new('/usr/local').entries
+ *   #=> [#<Pathname:share>,
+ *   #    #<Pathname:lib>,
+ *   #    #<Pathname:..>,
+ *   #    #<Pathname:include>,
+ *   #    #<Pathname:etc>,
+ *   #    #<Pathname:bin>,
+ *   #    #<Pathname:man>,
+ *   #    #<Pathname:games>,
+ *   #    #<Pathname:.>,
+ *   #    #<Pathname:sbin>,
+ *   #    #<Pathname:src>]
+ *
  */
 static VALUE
 path_entries(VALUE self)

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

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