diff --git a/ChangeLog b/ChangeLog index 3e80e35040..fe2f67da95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Sep 5 23:02:34 2010 Tanaka Akira + + * ext/pathname/pathname.c (path_owned_p): Pathname#owned? + translated from pathname.rb. + Sat Sep 4 23:48:47 2010 Nobuyoshi Nakada * file.c (rb_file_s_readlink): symlink target should be in 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); }