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

ruby-changes:17196

From: akr <ko1@a...>
Date: Wed, 8 Sep 2010 20:57:41 +0900 (JST)
Subject: [ruby-changes:17196] Ruby:r29196 (trunk): * ext/pathname/pathname.c (path_setgid_p): Pathname#setgid? translated

akr	2010-09-08 20:57:34 +0900 (Wed, 08 Sep 2010)

  New Revision: 29196

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

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

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29195)
+++ ChangeLog	(revision 29196)
@@ -1,3 +1,8 @@
+Wed Sep  8 20:56:57 2010  Tanaka Akira  <akr@f...>
+
+	* ext/pathname/pathname.c (path_setgid_p): Pathname#setgid? translated
+	  from pathname.rb.
+
 Wed Sep  8 06:25:41 2010  Tanaka Akira  <akr@f...>
 
 	* ext/pathname/pathname.c (path_setuid_p): Pathname#setuid? translated
Index: ext/pathname/lib/pathname.rb
===================================================================
--- ext/pathname/lib/pathname.rb	(revision 29195)
+++ ext/pathname/lib/pathname.rb	(revision 29196)
@@ -486,9 +486,6 @@
 
 class Pathname    # * FileTest *
 
-  # See <tt>FileTest.setgid?</tt>.
-  def setgid?() FileTest.setgid?(@path) end
-
   # See <tt>FileTest.size</tt>.
   def size() FileTest.size(@path) end
 
Index: ext/pathname/pathname.c
===================================================================
--- ext/pathname/pathname.c	(revision 29195)
+++ ext/pathname/pathname.c	(revision 29196)
@@ -733,6 +733,15 @@
 }
 
 /*
+ * See <tt>FileTest.setgid?</tt>.
+ */
+static VALUE
+path_setgid_p(VALUE self)
+{
+    return rb_funcall(rb_mFileTest, rb_intern("setgid?"), 1, get_strpath(self));
+}
+
+/*
  * == Pathname
  *
  * Pathname represents a pathname which locates a file in a filesystem.
@@ -976,4 +985,5 @@
     rb_define_method(rb_cPathname, "world_readable?", path_world_readable_p, 0);
     rb_define_method(rb_cPathname, "readable_real?", path_readable_real_p, 0);
     rb_define_method(rb_cPathname, "setuid?", path_setuid_p, 0);
+    rb_define_method(rb_cPathname, "setgid?", path_setgid_p, 0);
 }

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

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