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

ruby-changes:59342

From: Nobuyoshi <ko1@a...>
Date: Fri, 20 Dec 2019 15:13:37 +0900 (JST)
Subject: [ruby-changes:59342] 2b2030f265 (master): Refined the warning message for $, and $;

https://git.ruby-lang.org/ruby.git/commit/?id=2b2030f265

From 2b2030f265e4ec0782de9c8dd9f8828a1a0af1b5 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 20 Dec 2019 15:05:10 +0900
Subject: Refined the warning message for $, and $;

[Bug #16438]

diff --git a/io.c b/io.c
index caef68c..42528c0 100644
--- a/io.c
+++ b/io.c
@@ -7543,7 +7543,7 @@ rb_output_fs_setter(VALUE val, ID id, VALUE *var) https://github.com/ruby/ruby/blob/trunk/io.c#L7543
 {
     rb_str_setter(val, id, &val);
     if (!NIL_P(val)) {
-        rb_warn("non-nil $, will be deprecated");
+        rb_warn_deprecated("`$,'", NULL);
     }
     *var = val;
 }
diff --git a/string.c b/string.c
index 22ced32..d6fd731 100644
--- a/string.c
+++ b/string.c
@@ -10092,7 +10092,7 @@ rb_fs_setter(VALUE val, ID id, VALUE *var) https://github.com/ruby/ruby/blob/trunk/string.c#L10092
 		 rb_id2str(id));
     }
     if (!NIL_P(val)) {
-        rb_warn("non-nil $; will be deprecated");
+        rb_warn_deprecated("`$;'", NULL);
     }
     *var = val;
 }
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 0276d6a..09d099b 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1771,7 +1771,7 @@ CODE https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L1771
 
     begin
       fs = $;
-      assert_warn(/\$; will be deprecated/) {$; = " "}
+      assert_warn(/`\$;' is deprecated/) {$; = " "}
     ensure
       EnvUtil.suppress_warning {$; = fs}
     end
-- 
cgit v0.10.2


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

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