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

ruby-changes:30220

From: shugo <ko1@a...>
Date: Wed, 31 Jul 2013 18:29:52 +0900 (JST)
Subject: [ruby-changes:30220] shugo:r42272 (trunk): * eval.c (rb_mod_refine, mod_using, top_using): don't show

shugo	2013-07-31 18:29:40 +0900 (Wed, 31 Jul 2013)

  New Revision: 42272

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

  Log:
    * eval.c (rb_mod_refine, mod_using, top_using): don't show
      warnings because Refinements are no longer experimental.
      [ruby-core:55993] [Feature #8632]
    
    * test/ruby/test_refinement.rb: related test.
    
    * NEWS: fixes for the above change.

  Modified files:
    trunk/ChangeLog
    trunk/NEWS
    trunk/eval.c
    trunk/test/ruby/test_refinement.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42271)
+++ ChangeLog	(revision 42272)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jul 31 18:24:02 2013  Shugo Maeda  <shugo@r...>
+
+	* eval.c (rb_mod_refine, mod_using, top_using): don't show
+	  warnings because Refinements are no longer experimental.
+	  [ruby-core:55993] [Feature #8632]
+
+	* test/ruby/test_refinement.rb: related test.
+
+	* NEWS: fixes for the above change.
+
 Wed Jul 31 17:55:55 2013  Shota Fukumori  <her@s...>
 
 	* lib/uri/common.rb (URI.decode_www_form_component):
Index: eval.c
===================================================================
--- eval.c	(revision 42271)
+++ eval.c	(revision 42272)
@@ -1046,17 +1046,6 @@ rb_mod_prepend(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/eval.c#L1046
     return module;
 }
 
-static void
-warn_refinements_once()
-{
-    static int warned = 0;
-
-    if (warned)
-	return;
-    rb_warn("Refinements are experimental, and the behavior may change in future versions of Ruby!");
-    warned = 1;
-}
-
 static VALUE
 hidden_identity_hash_new()
 {
@@ -1213,7 +1202,6 @@ rb_mod_refine(VALUE module, VALUE klass) https://github.com/ruby/ruby/blob/trunk/eval.c#L1202
     rb_thread_t *th = GET_THREAD();
     rb_block_t *block = rb_vm_control_frame_block_ptr(th->cfp);
 
-    warn_refinements_once();
     if (!block) {
         rb_raise(rb_eArgError, "no block given");
     }
@@ -1265,7 +1253,6 @@ mod_using(VALUE self, VALUE module) https://github.com/ruby/ruby/blob/trunk/eval.c#L1253
     NODE *cref = rb_vm_cref();
     rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
 
-    warn_refinements_once();
     if (prev_frame_func()) {
 	rb_raise(rb_eRuntimeError,
 		 "Module#using is not permitted in methods");
@@ -1405,7 +1392,6 @@ top_using(VALUE self, VALUE module) https://github.com/ruby/ruby/blob/trunk/eval.c#L1392
     NODE *cref = rb_vm_cref();
     rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
 
-    warn_refinements_once();
     if (cref->nd_next || (prev_cfp && prev_cfp->me)) {
 	rb_raise(rb_eRuntimeError,
 		 "main.using is permitted only at toplevel");
Index: NEWS
===================================================================
--- NEWS	(revision 42271)
+++ NEWS	(revision 42272)
@@ -30,6 +30,8 @@ with all sufficient information, see the https://github.com/ruby/ruby/blob/trunk/NEWS#L30
   * New methods:
     * Module#using, which activates refinements of the specified module only
       in the current class or module definition.
+  * extended methods:
+    * Module#refine is no longer experimental.
 
 * Mutex
   * misc
@@ -48,8 +50,9 @@ with all sufficient information, see the https://github.com/ruby/ruby/blob/trunk/NEWS#L50
 
 * toplevel
   * extended methods:
-    * main.using activates refinements in the ancestors of the argument
-      module to support refinement inheritance by Module#include.
+    * main.using is no longer experimental. The method activates refinements
+      in the ancestors of the argument module to support refinement
+      inheritance by Module#include.
 
 === Core classes compatibility issues (excluding feature bug fixes)
 
Index: test/ruby/test_refinement.rb
===================================================================
--- test/ruby/test_refinement.rb	(revision 42271)
+++ test/ruby/test_refinement.rb	(revision 42272)
@@ -395,7 +395,7 @@ class TestRefinement < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/ruby/test_refinement.rb#L395
   end
 
   def test_main_using
-    assert_in_out_err([], <<-INPUT, %w(:C :M), /Refinements are experimental/)
+    assert_in_out_err([], <<-INPUT, %w(:C :M), [])
       class C
         def foo
           :C
@@ -461,7 +461,7 @@ class TestRefinement < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/ruby/test_refinement.rb#L461
   end
 
   def test_using_method_cache
-    assert_in_out_err([], <<-INPUT, %w(:M1 :M2), /Refinements are experimental/)
+    assert_in_out_err([], <<-INPUT, %w(:M1 :M2), [])
       class C
         def foo
           "original"

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

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