From 0c5b7fd01bd4333f1af1c051889570c458a70bf7 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 3 Sep 2010 14:51:51 +0000 Subject: * ext/pathname/pathname.c (path_socket_p): Pathname#socket? translated from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29176 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 aa46a91c49..4343de180e 100644 --- a/ext/pathname/lib/pathname.rb +++ b/ext/pathname/lib/pathname.rb @@ -486,9 +486,6 @@ end class Pathname # * FileTest * - # See FileTest.socket?. - def socket?() FileTest.socket?(@path) end - # See FileTest.owned?. def owned?() FileTest.owned?(@path) end diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index 6a24b84b47..98b0515402 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -678,6 +678,15 @@ path_pipe_p(VALUE self) return rb_funcall(rb_mFileTest, rb_intern("pipe?"), 1, get_strpath(self)); } +/* + * See FileTest.socket?. + */ +static VALUE +path_socket_p(VALUE self) +{ + return rb_funcall(rb_mFileTest, rb_intern("socket?"), 1, get_strpath(self)); +} + /* * == Pathname * @@ -916,4 +925,5 @@ Init_pathname() rb_define_method(rb_cPathname, "directory?", path_directory_p, 0); 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); } -- cgit v1.2.3