ruby-changes:31300
From: nobu <ko1@a...>
Date: Tue, 22 Oct 2013 00:35:00 +0900 (JST)
Subject: [ruby-changes:31300] nobu:r43379 (trunk): * file.c (rb_file_exists_p): maybe FileTest.
nobu 2013-10-22 00:34:55 +0900 (Tue, 22 Oct 2013) New Revision: 43379 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43379 Log: * file.c (rb_file_exists_p): maybe FileTest. Modified files: trunk/file.c Index: file.c =================================================================== --- file.c (revision 43378) +++ file.c (revision 43379) @@ -1400,7 +1400,16 @@ rb_file_exist_p(VALUE obj, VALUE fname) https://github.com/ruby/ruby/blob/trunk/file.c#L1400 static VALUE rb_file_exists_p(VALUE obj, VALUE fname) { - rb_warning("File.exists? is deprecated name, use File.exist? instead"); + const char *s = "FileTest#"; + if (obj == rb_mFileTest) { + s = "FileTest."; + } + else if (obj == rb_cFile || + (RB_TYPE_P(obj, T_CLASS) && + RTEST(rb_class_inherited_p(obj, rb_cFile)))) { + s = "File."; + } + rb_warning("%sexists? is deprecated name, use %sexist? instead", s, s); return rb_file_exist_p(obj, fname); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/