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

ruby-changes:17233

From: akr <ko1@a...>
Date: Sun, 12 Sep 2010 19:32:03 +0900 (JST)
Subject: [ruby-changes:17233] Ruby:r29233 (trunk): * ext/pathname/pathname.c (path_world_writable_p):

akr	2010-09-12 19:31:01 +0900 (Sun, 12 Sep 2010)

  New Revision: 29233

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

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

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29232)
+++ ChangeLog	(revision 29233)
@@ -1,3 +1,8 @@
+Sun Sep 12 19:30:27 2010  Tanaka Akira  <akr@f...>
+
+	* ext/pathname/pathname.c (path_world_writable_p):
+	  Pathname#world_writable? translated from pathname.rb.
+
 Sun Sep 12 09:16:06 2010  Tanaka Akira  <akr@f...>
 
 	* ext/pathname/pathname.c (path_writable_p): Pathname#writable?
Index: ext/pathname/lib/pathname.rb
===================================================================
--- ext/pathname/lib/pathname.rb	(revision 29232)
+++ ext/pathname/lib/pathname.rb	(revision 29233)
@@ -486,9 +486,6 @@
 
 class Pathname    # * FileTest *
 
-  # See <tt>FileTest.world_writable?</tt>.
-  def world_writable?() FileTest.world_writable?(@path) end
-
   # See <tt>FileTest.writable_real?</tt>.
   def writable_real?() FileTest.writable_real?(@path) end
 
Index: ext/pathname/pathname.c
===================================================================
--- ext/pathname/pathname.c	(revision 29232)
+++ ext/pathname/pathname.c	(revision 29233)
@@ -787,6 +787,15 @@
 }
 
 /*
+ * See <tt>FileTest.world_writable?</tt>.
+ */
+static VALUE
+path_world_writable_p(VALUE self)
+{
+    return rb_funcall(rb_mFileTest, rb_intern("world_writable?"), 1, get_strpath(self));
+}
+
+/*
  * == Pathname
  *
  * Pathname represents a pathname which locates a file in a filesystem.
@@ -1036,4 +1045,5 @@
     rb_define_method(rb_cPathname, "sticky?", path_sticky_p, 0);
     rb_define_method(rb_cPathname, "symlink?", path_symlink_p, 0);
     rb_define_method(rb_cPathname, "writable?", path_writable_p, 0);
+    rb_define_method(rb_cPathname, "world_writable?", path_world_writable_p, 0);
 }

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

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