1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
akr 2010-09-03 14:51:51 +00:00
parent aa5c05b8ba
commit 0c5b7fd01b
3 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Fri Sep 3 23:51:26 2010 Tanaka Akira <akr@fsij.org>
* ext/pathname/pathname.c (path_socket_p): Pathname#socket?
translated from pathname.rb.
Fri Sep 3 06:40:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/pty/pty.c (chfunc): pass through exceptions.

View file

@ -486,9 +486,6 @@ end
class Pathname # * FileTest *
# See <tt>FileTest.socket?</tt>.
def socket?() FileTest.socket?(@path) end
# See <tt>FileTest.owned?</tt>.
def owned?() FileTest.owned?(@path) end

View file

@ -678,6 +678,15 @@ path_pipe_p(VALUE self)
return rb_funcall(rb_mFileTest, rb_intern("pipe?"), 1, get_strpath(self));
}
/*
* See <tt>FileTest.socket?</tt>.
*/
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);
}