https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-01-04T00:12:11ZRuby Issue Tracking SystemRuby master - Bug #5776: irb のトップレベルで定義したメソッドが public になるhttps://bugs.ruby-lang.org/issues/5776?journal_id=230812012-01-04T00:12:11Zayumin (Ayumu AIZAWA)ayumu.aizawa@gmail.com
<ul><li><strong>Category</strong> set to <i>lib</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>keiju (Keiju Ishitsuka)</i></li><li><strong>Target version</strong> set to <i>2.0.0</i></li></ul><p>1.9.3-p0でも再現することを確認しました。</p> Ruby master - Bug #5776: irb のトップレベルで定義したメソッドが public になるhttps://bugs.ruby-lang.org/issues/5776?journal_id=275032012-06-27T08:06:14Zdavidbalbert (David Albert)davidbalbert@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/2820">0001-make-top-level-methods-defined-in-IRB-private.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/2820/0001-make-top-level-methods-defined-in-IRB-private.patch">0001-make-top-level-methods-defined-in-IRB-private.patch</a> added</li></ul><p>I ran into this bug recently and I did a bit of investigating. This is due to a change introduced by <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: attr_accessor creates a private writer method (Closed)" href="https://bugs.ruby-lang.org/issues/3406">#3406</a> (r29578) that made inner method definitions public regardless of the visibility of the method they were defined in.</p>
<p>I've attached a patch that calls <code>private</code> in the <code>irb_binding</code> method before returning the binding, which fixes the problem. I also verified that context mode 3 was the only mode affected by r29578 and that IRB works correctly when started via the command line and via <code>IRB.start</code>.</p> Ruby master - Bug #5776: irb のトップレベルで定義したメソッドが public になるhttps://bugs.ruby-lang.org/issues/5776?journal_id=350612012-12-25T20:21:21Zkeiju (Keiju Ishitsuka)keiju@ishitsuka.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r38597.<br>
hi, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>lib/irb/workspace.rb: define method to private on top-level irb<br>
[Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: irb のトップレベルで定義したメソッドが public になる (Closed)" href="https://bugs.ruby-lang.org/issues/5776">#5776</a>]. Patch by davidbalbert.</li>
</ul>