summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-31 09:29:40 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-31 09:29:40 +0000
commit1c7f9073b018319fbea5ffe98d7264d4553aaec1 (patch)
tree77c6dc199a1440a81d3724ed5d885c93ae1d8e5c
parentb30a1723853bc1a189930a5c7ebdfc5ec7e4817b (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--NEWS7
-rw-r--r--eval.c14
-rw-r--r--test/ruby/test_refinement.rb4
4 files changed, 17 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 9c3dc34..da8a2cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Wed Jul 31 18:24:02 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * 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@sorah.jp>
* lib/uri/common.rb (URI.decode_www_form_component):
diff --git a/NEWS b/NEWS
index ee83b1b..989ec80 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,8 @@ with all sufficient information, see the ChangeLog file.
* 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 ChangeLog file.
* 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)
diff --git a/eval.c b/eval.c
index 0bf8337..445524b 100644
--- a/eval.c
+++ b/eval.c
@@ -1046,17 +1046,6 @@ rb_mod_prepend(int argc, VALUE *argv, VALUE module)
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)
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)
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)
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");
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index e812e62..f1f5e9d 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -395,7 +395,7 @@ class TestRefinement < Test::Unit::TestCase
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::TestCase
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"