diff options
| author | Jack Nagel | 2015-03-10 23:25:31 -0400 |
|---|---|---|
| committer | Jack Nagel | 2015-03-10 23:25:31 -0400 |
| commit | 2ab8c6dac8d7c99d287285ac220f3af62a31a077 (patch) | |
| tree | 381aa81ca08ac84296b5b202c6aef528504c8349 /Library | |
| parent | bf57b522257a2924347934b4b4ec0af3c46c7bde (diff) | |
| download | homebrew-2ab8c6dac8d7c99d287285ac220f3af62a31a077.tar.bz2 | |
Silence method redefinition warning
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/debrew/irb.rb | 42 |
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 |
