aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/debrew
diff options
context:
space:
mode:
authorJack Nagel2013-02-07 22:31:05 -0600
committerJack Nagel2013-02-07 22:31:05 -0600
commit12b2f94946bf721c457176a5652b37ec5dac033a (patch)
tree79704edd8e3fa9f43e2a35ab5b1bf2fe6fc603f9 /Library/Homebrew/debrew
parent225546a3ee2d3f22e185e47d4db6f6716a56669b (diff)
downloadhomebrew-12b2f94946bf721c457176a5652b37ec5dac033a.tar.bz2
debrew: restore ARGV even when IRB.setup raises
Diffstat (limited to 'Library/Homebrew/debrew')
-rw-r--r--Library/Homebrew/debrew/irb.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/Library/Homebrew/debrew/irb.rb b/Library/Homebrew/debrew/irb.rb
index c81e3cf4b..0e6790af9 100644
--- a/Library/Homebrew/debrew/irb.rb
+++ b/Library/Homebrew/debrew/irb.rb
@@ -6,9 +6,12 @@ module IRB
def IRB.start_within(binding)
unless @setup_done
# make IRB ignore our command line arguments
- saved_args = ARGV.shift(ARGV.size)
- IRB.setup(nil)
- ARGV.concat(saved_args)
+ begin
+ saved_args = ARGV.shift(ARGV.size)
+ IRB.setup(nil)
+ ensure
+ ARGV.replace(saved_args)
+ end
@setup_done = true
end