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/pathname.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ext/pathname/pathname.c') 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