summaryrefslogtreecommitdiff
path: root/ext/pathname/pathname.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-13 11:48:58 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-13 11:48:58 +0000
commit878747437c662aaeac55e27254c6dbc3fb720b7d (patch)
tree2123ffebb6e640c158d42f7a2b5211a64cc67274 /ext/pathname/pathname.c
parentccd7af7e8303c4e7e8d96827c6c7df84dbaf767f (diff)
* ext/pathname/pathname.c (path_zero_p): Pathname#zero? translated
from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pathname/pathname.c')
-rw-r--r--ext/pathname/pathname.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index 61cf9d8..d1090f8 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -805,6 +805,15 @@ path_writable_real_p(VALUE self)
}
/*
+ * See <tt>FileTest.zero?</tt>.
+ */
+static VALUE
+path_zero_p(VALUE self)
+{
+ return rb_funcall(rb_mFileTest, rb_intern("zero?"), 1, get_strpath(self));
+}
+
+/*
* == Pathname
*
* Pathname represents a pathname which locates a file in a filesystem.
@@ -1056,4 +1065,5 @@ Init_pathname()
rb_define_method(rb_cPathname, "writable?", path_writable_p, 0);
rb_define_method(rb_cPathname, "world_writable?", path_world_writable_p, 0);
rb_define_method(rb_cPathname, "writable_real?", path_writable_real_p, 0);
+ rb_define_method(rb_cPathname, "zero?", path_zero_p, 0);
}