From 878747437c662aaeac55e27254c6dbc3fb720b7d Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 13 Sep 2010 11:48:58 +0000 Subject: * 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 --- ext/pathname/lib/pathname.rb | 7 ------- ext/pathname/pathname.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'ext/pathname') diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb index d00cf51b67..6cf6419e52 100644 --- a/ext/pathname/lib/pathname.rb +++ b/ext/pathname/lib/pathname.rb @@ -484,13 +484,6 @@ class Pathname end -class Pathname # * FileTest * - - # See FileTest.zero?. - def zero?() FileTest.zero?(@path) end -end - - class Pathname # * Dir * # See Dir.glob. Returns or yields Pathname objects. def Pathname.glob(*args) # :yield: pathname diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index 61cf9d850e..d1090f841c 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -804,6 +804,15 @@ path_writable_real_p(VALUE self) return rb_funcall(rb_mFileTest, rb_intern("writable_real?"), 1, get_strpath(self)); } +/* + * See FileTest.zero?. + */ +static VALUE +path_zero_p(VALUE self) +{ + return rb_funcall(rb_mFileTest, rb_intern("zero?"), 1, get_strpath(self)); +} + /* * == Pathname * @@ -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); } -- cgit v1.2.3