Project

General

Profile

Actions

Bug #14162

closed

Invoking binding.irb destructively shifts ARGV

Added by k0kubun (Takashi Kokubun) about 7 years ago. Updated almost 7 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 2.5.0dev (2017-12-05 trunk 61034) [x86_64-linux]
[ruby-core:84135]

Description

$ ruby -v
ruby 2.5.0dev (2017-12-05 trunk 61034) [x86_64-linux]
$ cat script.rb
binding.irb
binding.irb
$ ruby script.rb a b c

From: script.rb @ line 1 :

 => 1: binding.irb
    2: binding.irb

irb(main):001:0> p ARGV
["b", "c"]
=> ["b", "c"]
irb(main):002:0>

From: script.rb @ line 2 :

    1: binding.irb
 => 2: binding.irb

irb(main):001:0> p ARGV
["c"]
=> ["c"]

Is this intentional? This is reproductive on both Ruby 2.4 and 2.5.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0