[前][次][番号順一覧][スレッド一覧]

ruby-changes:31298

From: nobu <ko1@a...>
Date: Tue, 22 Oct 2013 00:07:03 +0900 (JST)
Subject: [ruby-changes:31298] nobu:r43377 (trunk): file.c: warn File.exists?

nobu	2013-10-22 00:06:59 +0900 (Tue, 22 Oct 2013)

  New Revision: 43377

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43377

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

  Modified files:
    trunk/ChangeLog
    trunk/file.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43376)
+++ ChangeLog	(revision 43377)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Oct 22 00:06:57 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* file.c (rb_file_exists_p): warn deprecated name.  [Bug #9041]
+
 Mon Oct 21 23:57:53 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* encoding.c (load_encoding): should preserve outer errinfo, so that
Index: file.c
===================================================================
--- file.c	(revision 43376)
+++ file.c	(revision 43377)
@@ -1397,6 +1397,13 @@ rb_file_exist_p(VALUE obj, VALUE fname) https://github.com/ruby/ruby/blob/trunk/file.c#L1397
     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) https://github.com/ruby/ruby/blob/trunk/file.c#L5586
 
     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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]