diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-04 00:39:24 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-04 00:39:24 +0000 |
commit | 82031fa8449ccc351da2e2c857d26be92c2cc281 (patch) | |
tree | 50da530e95e591b404a154474e0c58682ec58c37 /lib/irb.rb | |
parent | 737d15391a08d1bcac3b03de76375deac99df090 (diff) |
merge revision(s) 61149,61150,61151,61167: [Backport #14162]
irb.rb: preserve ARGV on binding.irb
This is not perfectly good solution (at least we don't want to have ARGV
as default value of `argv` argument), but unfortunately IRB.setup and
IRB.parse_opts are public methods and we can't make breaking change to
those methods.
We may deprecate using them and then make them private in the future,
but the removal should not be in Ruby 2.5. So I kept their interface for
now.
[Bug #14162] [close GH-1770]
* properties.
irb/init.rb: make sure ARGV refers to toplevel one
irb/test_init.rb: add test to ensure $0
is not changed.
At first `ARGV.unshift('something')` was suggested for r61149,
but it wasn't sufficient because it modifies $0.
Not only to preserve ARGV, but also r61149 intends to preserve $0.
This test prevents future breakage of the behavior.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb.rb')
-rw-r--r-- | lib/irb.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irb.rb b/lib/irb.rb index 676abe42cd..fb6102724d 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -709,7 +709,7 @@ end class Binding # :nodoc: def irb - IRB.setup(eval("__FILE__")) + IRB.setup(eval("__FILE__"), argv: []) IRB::Irb.new(IRB::WorkSpace.new(self)).run(IRB.conf) end end |