https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112017-12-10T04:22:48ZRuby Issue Tracking SystemRuby master - Bug #14162: Invoking binding.irb destructively shifts ARGVhttps://redmine.ruby-lang.org/issues/14162?journal_id=682472017-12-10T04:22:48Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><p>Also, the shifted value becomes $0 (and @CONF[:SCRIPT]).</p>
<p>I guessed they are not intentional and created a patch that skips parsing ARGV for binding.irb <a href="https://github.com/ruby/ruby/pull/1770" class="external">https://github.com/ruby/ruby/pull/1770</a>.</p> Ruby master - Bug #14162: Invoking binding.irb destructively shifts ARGVhttps://redmine.ruby-lang.org/issues/14162?journal_id=683262017-12-12T11:25:27Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset trunk|r61149.</p>
<hr>
<p>irb.rb: preserve ARGV on binding.irb</p>
<p>This is not perfectly good solution (at least we don't want to have ARGV<br>
as default value of <code>argv</code> argument), but unfortunately IRB.setup and<br>
IRB.parse_opts are public methods and we can't make breaking change to<br>
those methods.</p>
<p>We may deprecate using them and then make them private in the future,<br>
but the removal should not be in Ruby 2.5. So I kept their interface for<br>
now.</p>
<p>[Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Invoking binding.irb destructively shifts ARGV (Closed)" href="https://redmine.ruby-lang.org/issues/14162">#14162</a>] [close GH-1770]</p> Ruby master - Bug #14162: Invoking binding.irb destructively shifts ARGVhttps://redmine.ruby-lang.org/issues/14162?journal_id=701492018-02-04T00:39:29Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>2.3: DONTNEED, 2.4: REQUIRED</i> to <i>2.3: DONTNEED, 2.4: DONE</i></li></ul><p>ruby_2_4 r62185 merged revision(s) 61149,61150,61151,61167.</p>