aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/debrew.rb
diff options
context:
space:
mode:
authorJack Nagel2014-09-18 15:29:06 -0500
committerJack Nagel2014-09-18 15:29:10 -0500
commit84352d2728eb90dcb321955424acd088a9702d5d (patch)
treef32af6295a70eaa48f582fe99778a33e56ce2eb3 /Library/Homebrew/debrew.rb
parentc8bb68a79550d22fb6e934dac242b10a2f43f3ae (diff)
downloadbrew-84352d2728eb90dcb321955424acd088a9702d5d.tar.bz2
Delay requiring irb until runtime
Fixes Homebrew/homebrew#32410.
Diffstat (limited to 'Library/Homebrew/debrew.rb')
-rw-r--r--Library/Homebrew/debrew.rb27
1 files changed, 15 insertions, 12 deletions
diff --git a/Library/Homebrew/debrew.rb b/Library/Homebrew/debrew.rb
index bc1495a99..dae4a9758 100644
--- a/Library/Homebrew/debrew.rb
+++ b/Library/Homebrew/debrew.rb
@@ -1,5 +1,4 @@
require "mutex_m"
-require "debrew/irb" unless ENV["HOMEBREW_NO_READLINE"]
module Debrew
extend Mutex_m
@@ -130,17 +129,21 @@ module Debrew
menu.choice(:ignore) { return :ignore } if Ignorable === e
menu.choice(:backtrace) { puts e.backtrace }
- menu.choice(:irb) do
- puts "When you exit this IRB session, execution will continue."
- set_trace_func proc { |event, _, _, id, binding, klass|
- if klass == Raise && id == :raise && event == "return"
- set_trace_func(nil)
- synchronize { IRB.start_within(binding) }
- end
- }
-
- return :ignore
- end if Object.const_defined?(:IRB) && Ignorable === e
+ unless ENV["HOMEBREW_NO_READLINE"]
+ require "debrew/irb"
+
+ menu.choice(:irb) do
+ puts "When you exit this IRB session, execution will continue."
+ set_trace_func proc { |event, _, _, id, binding, klass|
+ if klass == Raise && id == :raise && event == "return"
+ set_trace_func(nil)
+ synchronize { IRB.start_within(binding) }
+ end
+ }
+
+ return :ignore
+ end if Ignorable === e
+ end
menu.choice(:shell) do
puts "When you exit this shell, you will return to the menu."