ruby-changes:17184
From: akr <ko1@a...>
Date: Mon, 6 Sep 2010 06:18:00 +0900 (JST)
Subject: [ruby-changes:17184] Ruby:r29184 (trunk): * ext/pathname/pathname.c (path_readable_p): Pathname#readable?
akr 2010-09-06 06:17:54 +0900 (Mon, 06 Sep 2010) New Revision: 29184 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29184 Log: * ext/pathname/pathname.c (path_readable_p): Pathname#readable? translated from pathname.rb. Modified files: trunk/ChangeLog trunk/ext/pathname/lib/pathname.rb trunk/ext/pathname/pathname.c Index: ChangeLog =================================================================== --- ChangeLog (revision 29183) +++ ChangeLog (revision 29184) @@ -1,3 +1,8 @@ +Mon Sep 6 06:17:21 2010 Tanaka Akira <akr@f...> + + * ext/pathname/pathname.c (path_readable_p): Pathname#readable? + translated from pathname.rb. + Sun Sep 5 23:02:34 2010 Tanaka Akira <akr@f...> * ext/pathname/pathname.c (path_owned_p): Pathname#owned? Index: ext/pathname/lib/pathname.rb =================================================================== --- ext/pathname/lib/pathname.rb (revision 29183) +++ ext/pathname/lib/pathname.rb (revision 29184) @@ -486,9 +486,6 @@ class Pathname # * FileTest * - # See <tt>FileTest.readable?</tt>. - def readable?() FileTest.readable?(@path) end - # See <tt>FileTest.world_readable?</tt>. def world_readable?() FileTest.world_readable?(@path) end Index: ext/pathname/pathname.c =================================================================== --- ext/pathname/pathname.c (revision 29183) +++ ext/pathname/pathname.c (revision 29184) @@ -697,6 +697,15 @@ } /* + * See <tt>FileTest.readable?</tt>. + */ +static VALUE +path_readable_p(VALUE self) +{ + return rb_funcall(rb_mFileTest, rb_intern("readable?"), 1, get_strpath(self)); +} + +/* * == Pathname * * Pathname represents a pathname which locates a file in a filesystem. @@ -936,4 +945,5 @@ 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); + rb_define_method(rb_cPathname, "readable?", path_readable_p, 0); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/