ruby-changes:17244
From: akr <ko1@a...>
Date: Mon, 13 Sep 2010 20:49:47 +0900 (JST)
Subject: [ruby-changes:17244] Ruby:r29244 (trunk): * ext/pathname/pathname.c (path_zero_p): Pathname#zero? translated
akr 2010-09-13 20:48:58 +0900 (Mon, 13 Sep 2010) New Revision: 29244 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29244 Log: * ext/pathname/pathname.c (path_zero_p): Pathname#zero? translated from pathname.rb. Modified files: trunk/ChangeLog trunk/ext/pathname/lib/pathname.rb trunk/ext/pathname/pathname.c Index: ChangeLog =================================================================== --- ChangeLog (revision 29243) +++ ChangeLog (revision 29244) @@ -1,3 +1,8 @@ +Mon Sep 13 20:48:30 2010 Tanaka Akira <akr@f...> + + * ext/pathname/pathname.c (path_zero_p): Pathname#zero? translated + from pathname.rb. + Mon Sep 13 19:56:50 2010 Nobuyoshi Nakada <nobu@r...> * ext/socket/rubysocket.h (__DARWIN_ALIGNBYTES): workaround of a Index: ext/pathname/lib/pathname.rb =================================================================== --- ext/pathname/lib/pathname.rb (revision 29243) +++ ext/pathname/lib/pathname.rb (revision 29244) @@ -484,13 +484,6 @@ end -class Pathname # * FileTest * - - # See <tt>FileTest.zero?</tt>. - def zero?() FileTest.zero?(@path) end -end - - class Pathname # * Dir * # See <tt>Dir.glob</tt>. Returns or yields Pathname objects. def Pathname.glob(*args) # :yield: pathname Index: ext/pathname/pathname.c =================================================================== --- ext/pathname/pathname.c (revision 29243) +++ ext/pathname/pathname.c (revision 29244) @@ -805,6 +805,15 @@ } /* + * 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 @@ 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); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/