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

ruby-changes:17182

From: akr <ko1@a...>
Date: Sun, 5 Sep 2010 23:03:16 +0900 (JST)
Subject: [ruby-changes:17182] Ruby:r29182 (trunk): * ext/pathname/pathname.c (path_owned_p): Pathname#owned?

akr	2010-09-05 23:03:06 +0900 (Sun, 05 Sep 2010)

  New Revision: 29182

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

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

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29181)
+++ ChangeLog	(revision 29182)
@@ -1,3 +1,8 @@
+Sun Sep  5 23:02:34 2010  Tanaka Akira  <akr@f...>
+
+	* ext/pathname/pathname.c (path_owned_p): Pathname#owned?
+	  translated from pathname.rb.
+
 Sat Sep  4 23:48:47 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* file.c (rb_file_s_readlink): symlink target should be in
Index: ext/pathname/lib/pathname.rb
===================================================================
--- ext/pathname/lib/pathname.rb	(revision 29181)
+++ ext/pathname/lib/pathname.rb	(revision 29182)
@@ -486,9 +486,6 @@
 
 class Pathname    # * FileTest *
 
-  # See <tt>FileTest.owned?</tt>.
-  def owned?() FileTest.owned?(@path) end
-
   # See <tt>FileTest.readable?</tt>.
   def readable?() FileTest.readable?(@path) end
 
Index: ext/pathname/pathname.c
===================================================================
--- ext/pathname/pathname.c	(revision 29181)
+++ ext/pathname/pathname.c	(revision 29182)
@@ -688,6 +688,15 @@
 }
 
 /*
+ * See <tt>FileTest.owned?</tt>.
+ */
+static VALUE
+path_owned_p(VALUE self)
+{
+    return rb_funcall(rb_mFileTest, rb_intern("owned?"), 1, get_strpath(self));
+}
+
+/*
  * == Pathname
  *
  * Pathname represents a pathname which locates a file in a filesystem.
@@ -926,4 +935,5 @@
     rb_define_method(rb_cPathname, "file?", path_file_p, 0);
     rb_define_method(rb_cPathname, "pipe?", path_pipe_p, 0);
     rb_define_method(rb_cPathname, "socket?", path_socket_p, 0);
+    rb_define_method(rb_cPathname, "owned?", path_owned_p, 0);
 }

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

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