From 5e620bdd65c703c8527d7165f41155b89a8b36a4 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 5 Sep 2010 14:03:06 +0000 Subject: * ext/pathname/pathname.c (path_owned_p): Pathname#owned? translated from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/pathname/lib/pathname.rb | 3 --- ext/pathname/pathname.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'ext/pathname') diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb index 4343de180e..180bc4c970 100644 --- a/ext/pathname/lib/pathname.rb +++ b/ext/pathname/lib/pathname.rb @@ -486,9 +486,6 @@ end class Pathname # * FileTest * - # See FileTest.owned?. - def owned?() FileTest.owned?(@path) end - # See FileTest.readable?. def readable?() FileTest.readable?(@path) end diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index 98b0515402..b15b897366 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -687,6 +687,15 @@ path_socket_p(VALUE self) return rb_funcall(rb_mFileTest, rb_intern("socket?"), 1, get_strpath(self)); } +/* + * See FileTest.owned?. + */ +static VALUE +path_owned_p(VALUE self) +{ + return rb_funcall(rb_mFileTest, rb_intern("owned?"), 1, get_strpath(self)); +} + /* * == Pathname * @@ -926,4 +935,5 @@ Init_pathname() 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); } -- cgit v1.2.3