aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2015-03-10 23:25:31 -0400
committerJack Nagel2015-03-10 23:25:31 -0400
commitb149580632d2f5f6cfe8a6e028028ef85acafaee (patch)
tree06df64885fd1348fe4e1d31ab18d4c9d5c871c90 /Library/Homebrew
parentf3e4b563d40335586a1de1d6bc6c36b48255b71e (diff)
downloadbrew-b149580632d2f5f6cfe8a6e028028ef85acafaee.tar.bz2
Silence method redefinition warning
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/debrew/irb.rb42
1 files changed, 22 insertions, 20 deletions
diff --git a/Library/Homebrew/debrew/irb.rb b/Library/Homebrew/debrew/irb.rb
index c3a16c046..8d81558b1 100644
--- a/Library/Homebrew/debrew/irb.rb
+++ b/Library/Homebrew/debrew/irb.rb
@@ -3,31 +3,33 @@ require 'irb'
module IRB
@setup_done = false
- def IRB.parse_opts
- end
-
- def IRB.start_within(binding)
- unless @setup_done
- IRB.setup(nil)
- @setup_done = true
+ extend Module.new {
+ def parse_opts
end
- workspace = WorkSpace.new(binding)
- irb = Irb.new(workspace)
+ def start_within(binding)
+ unless @setup_done
+ setup(nil)
+ @setup_done = true
+ end
- @CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
- @CONF[:MAIN_CONTEXT] = irb.context
+ workspace = WorkSpace.new(binding)
+ irb = Irb.new(workspace)
- trap("SIGINT") do
- irb.signal_handle
- end
+ @CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
+ @CONF[:MAIN_CONTEXT] = irb.context
+
+ trap("SIGINT") do
+ irb.signal_handle
+ end
- begin
- catch(:IRB_EXIT) do
- irb.eval_input
+ begin
+ catch(:IRB_EXIT) do
+ irb.eval_input
+ end
+ ensure
+ irb_at_exit
end
- ensure
- irb_at_exit
end
- end
+ }
end