diff options
| author | Jack Nagel | 2013-02-07 18:58:41 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-02-07 19:02:20 -0600 |
| commit | 89d13c6e02a4748d10db9783eec89ceacbaab8af (patch) | |
| tree | 7e5e7d278e50b3364cf2ff3b7ce8f6c92ab5720c | |
| parent | a1aea154a84d3d49d7fd7f840ffe1377d8d8aa65 (diff) | |
| download | homebrew-89d13c6e02a4748d10db9783eec89ceacbaab8af.tar.bz2 | |
Reduce footprint of readline hack
| -rw-r--r-- | Library/Homebrew/debrew.rb | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/Library/Homebrew/debrew.rb b/Library/Homebrew/debrew.rb index 5e51228ec..e0d562cc9 100644 --- a/Library/Homebrew/debrew.rb +++ b/Library/Homebrew/debrew.rb @@ -1,23 +1,18 @@ -def can_use_readline? - not ENV['HOMEBREW_NO_READLINE'] -end - require 'debrew/menu' require 'debrew/raise_plus' -require 'debrew/irb' if can_use_readline? - -class Object - include RaisePlus -end -def has_debugger? +unless ENV['HOMEBREW_NO_READLINE'] begin require 'rubygems' require 'ruby-debug' - true rescue LoadError - false - end if can_use_readline? + end + + require 'debrew/irb' +end + +class Object + include RaisePlus end def debrew(exception, formula=nil) @@ -34,7 +29,7 @@ def debrew(exception, formula=nil) menu.choice(:debug) do puts "When you exit the debugger, execution will continue." exception.restart { debugger } - end if has_debugger? + end if Object.const_defined?(:Debugger) menu.choice(:irb) do puts "When you exit this IRB session, execution will continue." exception.restart do @@ -46,7 +41,7 @@ def debrew(exception, formula=nil) end } end - end if can_use_readline? + end if Object.const_defined?(:IRB) menu.choice(:shell) do puts "When you exit this shell, you will return to the menu." interactive_shell formula |
