зеркало из https://github.com/github/ruby.git
* ext/pathname/pathname.c (path_size): Pathname#size translated from
pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
96688ecbab
Коммит
eb0c31b1ad
|
@ -1,3 +1,8 @@
|
|||
Thu Sep 9 22:39:08 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (path_size): Pathname#size translated from
|
||||
pathname.rb.
|
||||
|
||||
Thu Sep 9 22:34:48 2010 wanabe <s.wanabe@gmail.com>
|
||||
|
||||
* compile.c (case_when_optimizable_literal): When float value can be
|
||||
|
|
|
@ -486,9 +486,6 @@ end
|
|||
|
||||
class Pathname # * FileTest *
|
||||
|
||||
# See <tt>FileTest.size</tt>.
|
||||
def size() FileTest.size(@path) end
|
||||
|
||||
# See <tt>FileTest.size?</tt>.
|
||||
def size?() FileTest.size?(@path) end
|
||||
|
||||
|
|
|
@ -741,6 +741,15 @@ path_setgid_p(VALUE self)
|
|||
return rb_funcall(rb_mFileTest, rb_intern("setgid?"), 1, get_strpath(self));
|
||||
}
|
||||
|
||||
/*
|
||||
* See <tt>FileTest.size</tt>.
|
||||
*/
|
||||
static VALUE
|
||||
path_size(VALUE self)
|
||||
{
|
||||
return rb_funcall(rb_mFileTest, rb_intern("size"), 1, get_strpath(self));
|
||||
}
|
||||
|
||||
/*
|
||||
* == Pathname
|
||||
*
|
||||
|
@ -986,4 +995,5 @@ Init_pathname()
|
|||
rb_define_method(rb_cPathname, "readable_real?", path_readable_real_p, 0);
|
||||
rb_define_method(rb_cPathname, "setuid?", path_setuid_p, 0);
|
||||
rb_define_method(rb_cPathname, "setgid?", path_setgid_p, 0);
|
||||
rb_define_method(rb_cPathname, "size", path_size, 0);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче