ruby-changes:16892
From: akr <ko1@a...>
Date: Fri, 6 Aug 2010 21:30:43 +0900 (JST)
Subject: [ruby-changes:16892] Ruby:r28888 (trunk): * ext/pathname/pathname.c (path_chmod): Pathname#chmod translated from
akr 2010-08-06 21:30:28 +0900 (Fri, 06 Aug 2010) New Revision: 28888 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28888 Log: * ext/pathname/pathname.c (path_chmod): Pathname#chmod translated from pathname.rb. Modified files: trunk/ChangeLog trunk/ext/pathname/lib/pathname.rb trunk/ext/pathname/pathname.c Index: ChangeLog =================================================================== --- ChangeLog (revision 28887) +++ ChangeLog (revision 28888) @@ -1,3 +1,8 @@ +Fri Aug 6 21:30:06 2010 Tanaka Akira <akr@f...> + + * ext/pathname/pathname.c (path_chmod): Pathname#chmod translated from + pathname.rb. + Fri Aug 6 20:13:42 2010 Nobuyoshi Nakada <nobu@r...> * rational.c (nurat_div): divided by infinity should be zero. Index: ext/pathname/lib/pathname.rb =================================================================== --- ext/pathname/lib/pathname.rb (revision 28887) +++ ext/pathname/lib/pathname.rb (revision 28888) @@ -512,9 +512,6 @@ class Pathname # * File * - # See <tt>File.chmod</tt>. Changes permissions. - def chmod(mode) File.chmod(mode, @path) end - # See <tt>File.lchmod</tt>. def lchmod(mode) File.lchmod(mode, @path) end Index: ext/pathname/pathname.c =================================================================== --- ext/pathname/pathname.c (revision 28887) +++ ext/pathname/pathname.c (revision 28888) @@ -260,6 +260,15 @@ } /* + * See <tt>File.chmod</tt>. Changes permissions. + */ +static VALUE +path_chmod(VALUE self, VALUE mode) +{ + return rb_funcall(rb_cFile, rb_intern("chmod"), 2, mode, get_strpath(self)); +} + +/* * == Pathname * * Pathname represents a pathname which locates a file in a filesystem. @@ -462,4 +471,5 @@ rb_define_method(rb_cPathname, "atime", path_atime, 0); 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); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/