* ext/pathname/pathname.c (path_exist_p): Pathname#exist? translated

from pathname.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2010-08-31 12:11:02 +00:00
Родитель b0993426bb
Коммит 3121057559
4 изменённых файлов: 16 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Aug 31 21:10:23 2010 Tanaka Akira <akr@fsij.org>
* ext/pathname/pathname.c (path_exist_p): Pathname#exist? translated
from pathname.rb.
Tue Aug 31 17:32:34 2010 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/stubs.c: fix [Bug #3771] "VC++ can't make ext/tk with enabling

Просмотреть файл

@ -524,7 +524,7 @@ Sun Aug 8 07:18:22 2010 Tanaka Akira <akr@fsij.org>
Sun Aug 8 00:41:42 2010 Tanaka Akira <akr@fsij.org>
* include/ruby/subst.h: new file for substitute standard functions..
* include/ruby/subst.h: new file for substitute standard functions.
* include/ruby/missing.h: don't substitute "close", etc. here.

Просмотреть файл

@ -486,9 +486,6 @@ end
class Pathname # * FileTest *
# See <tt>FileTest.exist?</tt>.
def exist?() FileTest.exist?(@path) end
# See <tt>FileTest.grpowned?</tt>.
def grpowned?() FileTest.grpowned?(@path) end

Просмотреть файл

@ -633,6 +633,15 @@ path_executable_real_p(VALUE self)
return rb_funcall(rb_mFileTest, rb_intern("executable_real?"), 1, get_strpath(self));
}
/*
* See <tt>FileTest.exist?</tt>.
*/
static VALUE
path_exist_p(VALUE self)
{
return rb_funcall(rb_mFileTest, rb_intern("exist?"), 1, get_strpath(self));
}
/*
* == Pathname
*
@ -866,4 +875,5 @@ Init_pathname()
rb_define_method(rb_cPathname, "chardev?", path_chardev_p, 0);
rb_define_method(rb_cPathname, "executable?", path_executable_p, 0);
rb_define_method(rb_cPathname, "executable_real?", path_executable_real_p, 0);
rb_define_method(rb_cPathname, "exist?", path_exist_p, 0);
}