Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* 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
  • Loading branch information...
commit 0c5b7fd01bd4333f1af1c051889570c458a70bf7 1 parent aa5c05b
@akr akr authored
View
5 ChangeLog
@@ -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
3  ext/pathname/lib/pathname.rb
@@ -486,9 +486,6 @@ def relative_path_from(base_directory)
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
10 ext/pathname/pathname.c
@@ -679,6 +679,15 @@ path_pipe_p(VALUE 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
*
* Pathname represents a pathname which locates a file in a filesystem.
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.