* ext/pathname/pathname.c (path_readable_p): Pathname#readable?

translated from pathname.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2010-09-05 21:17:54 +00:00
Родитель cdaf07f619
Коммит efe86e6c0d
3 изменённых файлов: 15 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Mon Sep 6 06:17:21 2010 Tanaka Akira <akr@fsij.org>
* ext/pathname/pathname.c (path_readable_p): Pathname#readable?
translated from pathname.rb.
Sun Sep 5 23:02:34 2010 Tanaka Akira <akr@fsij.org>
* ext/pathname/pathname.c (path_owned_p): Pathname#owned?

Просмотреть файл

@ -486,9 +486,6 @@ end
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

Просмотреть файл

@ -696,6 +696,15 @@ path_owned_p(VALUE self)
return rb_funcall(rb_mFileTest, rb_intern("owned?"), 1, get_strpath(self));
}
/*
* 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
*
@ -936,4 +945,5 @@ Init_pathname()
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);
}