ruby-changes:38504
From: zzak <ko1@a...>
Date: Thu, 21 May 2015 15:40:55 +0900 (JST)
Subject: [ruby-changes:38504] zzak:r50585 (trunk): * vm_method.c: Remove private attribute warning [Bug #10967]
zzak 2015-05-21 15:40:27 +0900 (Thu, 21 May 2015) New Revision: 50585 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50585 Log: * vm_method.c: Remove private attribute warning [Bug #10967] Patch by @spastorino [Fixes GH-849] https://github.com/ruby/ruby/pull/849 * test/ruby/test_module.rb: Update test for changes Modified files: trunk/ChangeLog trunk/test/ruby/test_module.rb trunk/vm_method.c Index: ChangeLog =================================================================== --- ChangeLog (revision 50584) +++ ChangeLog (revision 50585) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu May 21 15:37:32 2015 Zachary Scott <e@z...> + + * vm_method.c: Remove private attribute warning [Bug #10967] + Patch by @spastorino [Fixes GH-849] + https://github.com/ruby/ruby/pull/849 + + * test/ruby/test_module.rb: Update test for changes + Thu May 21 10:59:43 2015 Koichi Sasada <ko1@a...> * proc.c (method_proc): rename to method_to_proc. Index: vm_method.c =================================================================== --- vm_method.c (revision 50584) +++ vm_method.c (revision 50585) @@ -917,9 +917,9 @@ rb_attr(VALUE klass, ID id, int read, in https://github.com/ruby/ruby/blob/trunk/vm_method.c#L917 else { if (SCOPE_TEST(NOEX_PRIVATE)) { noex = NOEX_PRIVATE; - rb_warning((SCOPE_CHECK(NOEX_MODFUNC)) ? - "attribute accessor as module_function" : - "private attribute?"); + if (SCOPE_CHECK(NOEX_MODFUNC)) { + rb_warning("attribute accessor as module_function"); + } } else if (SCOPE_TEST(NOEX_PROTECTED)) { noex = NOEX_PROTECTED; Index: test/ruby/test_module.rb =================================================================== --- test/ruby/test_module.rb (revision 50584) +++ test/ruby/test_module.rb (revision 50585) @@ -836,7 +836,7 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L836 end def test_attr - assert_in_out_err([], <<-INPUT, %w(:ok nil), /warning: private attribute\?$/) + assert_in_out_err([], <<-INPUT, %w(nil)) $VERBOSE = true c = Class.new c.instance_eval do @@ -844,7 +844,6 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L844 attr_reader :foo end o = c.new - o.foo rescue p(:ok) p(o.instance_eval { foo }) INPUT -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/