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

ruby-changes:16894

From: akr <ko1@a...>
Date: Sat, 7 Aug 2010 02:09:50 +0900 (JST)
Subject: [ruby-changes:16894] Ruby:r28889 (trunk): * ext/pathname/pathname.c (path_lchmod): Pathname#lchmod translated

akr	2010-08-07 02:09:31 +0900 (Sat, 07 Aug 2010)

  New Revision: 28889

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

  Log:
    * ext/pathname/pathname.c (path_lchmod): Pathname#lchmod translated
      from pathname.rb.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 28888)
+++ ChangeLog	(revision 28889)
@@ -1,3 +1,8 @@
+Sat Aug  7 02:09:04 2010  Tanaka Akira  <akr@f...>
+
+	* ext/pathname/pathname.c (path_lchmod): Pathname#lchmod translated
+	  from pathname.rb.
+
 Fri Aug  6 21:30:06 2010  Tanaka Akira  <akr@f...>
 
 	* ext/pathname/pathname.c (path_chmod): Pathname#chmod translated from
Index: ext/pathname/lib/pathname.rb
===================================================================
--- ext/pathname/lib/pathname.rb	(revision 28888)
+++ ext/pathname/lib/pathname.rb	(revision 28889)
@@ -512,9 +512,6 @@
 
 class Pathname    # * File *
 
-  # See <tt>File.lchmod</tt>.
-  def lchmod(mode) File.lchmod(mode, @path) end
-
   # See <tt>File.chown</tt>.  Change owner and group of file.
   def chown(owner, group) File.chown(owner, group, @path) end
 
Index: ext/pathname/pathname.c
===================================================================
--- ext/pathname/pathname.c	(revision 28888)
+++ ext/pathname/pathname.c	(revision 28889)
@@ -269,6 +269,15 @@
 }
 
 /*
+ * See <tt>File.lchmod</tt>.
+ */
+static VALUE
+path_lchmod(VALUE self, VALUE mode)
+{
+    return rb_funcall(rb_cFile, rb_intern("lchmod"), 2, mode, get_strpath(self));
+}
+
+/*
  * == Pathname
  *
  * Pathname represents a pathname which locates a file in a filesystem.
@@ -472,4 +481,5 @@
     rb_define_method(rb_cPathname, "ctime", path_ctime, 0);
     rb_define_method(rb_cPathname, "mtime", path_mtime, 0);
     rb_define_method(rb_cPathname, "chmod", path_chmod, 1);
+    rb_define_method(rb_cPathname, "lchmod", path_lchmod, 1);
 }

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

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