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

ruby-changes:17191

From: akr <ko1@a...>
Date: Mon, 6 Sep 2010 23:08:18 +0900 (JST)
Subject: [ruby-changes:17191] Ruby:r29191 (trunk): * ext/pathname/pathname.c (path_world_readable_p):

akr	2010-09-06 23:08:08 +0900 (Mon, 06 Sep 2010)

  New Revision: 29191

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

  Log:
    * ext/pathname/pathname.c (path_world_readable_p):
      Pathname#world_readable?  translated from pathname.rb.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29190)
+++ ChangeLog	(revision 29191)
@@ -1,3 +1,8 @@
+Mon Sep  6 23:07:25 2010  Tanaka Akira  <akr@f...>
+
+	* ext/pathname/pathname.c (path_world_readable_p):
+	  Pathname#world_readable?  translated from pathname.rb.
+
 Mon Sep  6 11:03:13 2010  NAKAMURA, Hiroshi  <nahi@r...>
 
 	* Fixed wrong check of missing functions. Patch by Adrian Quark.
Index: ext/pathname/lib/pathname.rb
===================================================================
--- ext/pathname/lib/pathname.rb	(revision 29190)
+++ ext/pathname/lib/pathname.rb	(revision 29191)
@@ -486,9 +486,6 @@
 
 class Pathname    # * FileTest *
 
-  # See <tt>FileTest.world_readable?</tt>.
-  def world_readable?() FileTest.world_readable?(@path) end
-
   # See <tt>FileTest.readable_real?</tt>.
   def readable_real?() FileTest.readable_real?(@path) end
 
Index: ext/pathname/pathname.c
===================================================================
--- ext/pathname/pathname.c	(revision 29190)
+++ ext/pathname/pathname.c	(revision 29191)
@@ -706,6 +706,15 @@
 }
 
 /*
+ * See <tt>FileTest.world_readable?</tt>.
+ */
+static VALUE
+path_world_readable_p(VALUE self)
+{
+    return rb_funcall(rb_mFileTest, rb_intern("world_readable?"), 1, get_strpath(self));
+}
+
+/*
  * == Pathname
  *
  * Pathname represents a pathname which locates a file in a filesystem.
@@ -946,4 +955,5 @@
     rb_define_method(rb_cPathname, "socket?", path_socket_p, 0);
     rb_define_method(rb_cPathname, "owned?", path_owned_p, 0);
     rb_define_method(rb_cPathname, "readable?", path_readable_p, 0);
+    rb_define_method(rb_cPathname, "world_readable?", path_world_readable_p, 0);
 }

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

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