aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-06 21:37:42 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-06 21:43:32 +0900
commita58bbd6a512d95ca010d8bebae4fe590400c1413 (patch)
treea07ac45e8b385e5c476dea41255489a3cf11bbf0 /file.c
parentb66d7d9be56c27bc1b6ff5a6d8f0ca23de7ed28a (diff)
downloadruby-a58bbd6a512d95ca010d8bebae4fe590400c1413.tar.gz
Use `rb_warn_deprecated` for `File.exists?` and `Dir.exists?`
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/file.c b/file.c
index c267781d20..929dac8c34 100644
--- a/file.c
+++ b/file.c
@@ -1782,16 +1782,16 @@ rb_file_exist_p(VALUE obj, VALUE fname)
static VALUE
rb_file_exists_p(VALUE obj, VALUE fname)
{
- const char *s = "FileTest#";
+ const char *s = "FileTest#exist?";
if (obj == rb_mFileTest) {
- s = "FileTest.";
+ s = "FileTest.exist?";
}
else if (obj == rb_cFile ||
(RB_TYPE_P(obj, T_CLASS) &&
RTEST(rb_class_inherited_p(obj, rb_cFile)))) {
- s = "File.";
+ s = "File.exist?";
}
- rb_warning("%sexists? is a deprecated name, use %sexist? instead", s, s);
+ rb_warn_deprecated("", s);
return rb_file_exist_p(obj, fname);
}