1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

file.c: warn File.exists?

* file.c (rb_file_exists_p): warn deprecated name.  [Bug #9041]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-10-21 15:06:59 +00:00
parent 274e50c189
commit 058d55ad2c
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Tue Oct 22 00:06:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_exists_p): warn deprecated name. [Bug #9041]
Mon Oct 21 23:57:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* encoding.c (load_encoding): should preserve outer errinfo, so that

9
file.c
View file

@ -1397,6 +1397,13 @@ rb_file_exist_p(VALUE obj, VALUE fname)
return Qtrue;
}
static VALUE
rb_file_exists_p(VALUE obj, VALUE fname)
{
rb_warning("File.exists? is deprecated name, use File.exist? instead");
return rb_file_exist_p(obj, fname);
}
/*
* call-seq:
* File.readable?(file_name) -> true or false
@ -5579,7 +5586,7 @@ Init_File(void)
define_filetest_function("directory?", rb_file_directory_p, 1);
define_filetest_function("exist?", rb_file_exist_p, 1);
define_filetest_function("exists?", rb_file_exist_p, 1);
define_filetest_function("exists?", rb_file_exists_p, 1);
define_filetest_function("readable?", rb_file_readable_p, 1);
define_filetest_function("readable_real?", rb_file_readable_real_p, 1);
define_filetest_function("world_readable?", rb_file_world_readable_p, 1);