зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
ccd7af7e83
Коммит
878747437c
|
@ -1,3 +1,8 @@
|
|||
Mon Sep 13 20:48:30 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (path_zero_p): Pathname#zero? translated
|
||||
from pathname.rb.
|
||||
|
||||
Mon Sep 13 19:56:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/socket/rubysocket.h (__DARWIN_ALIGNBYTES): workaround of a
|
||||
|
|
|
@ -484,13 +484,6 @@ class Pathname
|
|||
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
|
||||
|
|
|
@ -804,6 +804,15 @@ path_writable_real_p(VALUE self)
|
|||
return rb_funcall(rb_mFileTest, rb_intern("writable_real?"), 1, get_strpath(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
|
||||
*
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче