ruby-changes:17176
From: akr <ko1@a...>
Date: Fri, 3 Sep 2010 23:57:13 +0900 (JST)
Subject: [ruby-changes:17176] Ruby:r29176 (trunk): * ext/pathname/pathname.c (path_socket_p): Pathname#socket?
akr 2010-09-03 23:51:51 +0900 (Fri, 03 Sep 2010) New Revision: 29176 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29176 Log: * ext/pathname/pathname.c (path_socket_p): Pathname#socket? translated from pathname.rb. Modified files: trunk/ChangeLog trunk/ext/pathname/lib/pathname.rb trunk/ext/pathname/pathname.c Index: ChangeLog =================================================================== --- ChangeLog (revision 29175) +++ ChangeLog (revision 29176) @@ -1,3 +1,8 @@ +Fri Sep 3 23:51:26 2010 Tanaka Akira <akr@f...> + + * ext/pathname/pathname.c (path_socket_p): Pathname#socket? + translated from pathname.rb. + Fri Sep 3 06:40:44 2010 Nobuyoshi Nakada <nobu@r...> * ext/pty/pty.c (chfunc): pass through exceptions. Index: ext/pathname/lib/pathname.rb =================================================================== --- ext/pathname/lib/pathname.rb (revision 29175) +++ ext/pathname/lib/pathname.rb (revision 29176) @@ -486,9 +486,6 @@ 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 Index: ext/pathname/pathname.c =================================================================== --- ext/pathname/pathname.c (revision 29175) +++ ext/pathname/pathname.c (revision 29176) @@ -679,6 +679,15 @@ } /* + * 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 * * Pathname represents a pathname which locates a file in a filesystem. @@ -916,4 +925,5 @@ 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); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/