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

ruby-changes:60677

From: Nobuyoshi <ko1@a...>
Date: Tue, 7 Apr 2020 12:50:10 +0900 (JST)
Subject: [ruby-changes:60677] 67f616c523 (master): Show the deprecated name in the warning

https://git.ruby-lang.org/ruby.git/commit/?id=67f616c523

From 67f616c523023080c037784ff49739c76f108741 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 7 Apr 2020 12:43:34 +0900
Subject: Show the deprecated name in the warning

Fixed up a58bbd6a512d95ca010d8bebae4fe590400c1413.

diff --git a/dir.c b/dir.c
index eaabc0a..303e291 100644
--- a/dir.c
+++ b/dir.c
@@ -3337,7 +3337,7 @@ rb_file_directory_p(void) https://github.com/ruby/ruby/blob/trunk/dir.c#L3337
 static VALUE
 rb_dir_exists_p(VALUE obj, VALUE fname)
 {
-    rb_warn_deprecated("", "Dir.exist?");
+    rb_warn_deprecated("Dir.exists?", "Dir.exist?");
     return rb_file_directory_p(obj, fname);
 }
 
diff --git a/file.c b/file.c
index 6d8adac..e14a658 100644
--- a/file.c
+++ b/file.c
@@ -1786,7 +1786,7 @@ rb_file_exists_p(VALUE obj, VALUE fname) https://github.com/ruby/ruby/blob/trunk/file.c#L1786
 	      RTEST(rb_class_inherited_p(obj, rb_cFile)))) {
 	s = "File.exist?";
     }
-    rb_warn_deprecated("", s);
+    rb_warn_deprecated("%.*ss?", s, (int)(strlen(s)-1), s);
     return rb_file_exist_p(obj, fname);
 }
 
-- 
cgit v0.10.2


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

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