diff --git a/Library/Homebrew/debrew.rb b/Library/Homebrew/debrew.rb index 4a48d7090d..b1f14b1413 100644 --- a/Library/Homebrew/debrew.rb +++ b/Library/Homebrew/debrew.rb @@ -1,4 +1,5 @@ require "mutex_m" +require "debrew/irb" module Debrew extend Mutex_m @@ -120,21 +121,17 @@ module Debrew menu.choice(:ignore) { return :ignore } if Ignorable === e menu.choice(:backtrace) { puts e.backtrace } - 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 + } - 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 + return :ignore + end if Ignorable === e menu.choice(:shell) do puts "When you exit this shell, you will return to the menu." diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 3515c66de3..b37b65fe68 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -190,14 +190,6 @@ class FormulaInstaller opoo "Nothing was installed to #{formula.prefix}" unless formula.installed? end - # HACK: If readline is present in the dependency tree, it will clash - # with the stdlib's Readline module when the debugger is loaded - def perform_readline_hack - if (formula.recursive_dependencies.any? { |d| d.name == "readline" } || formula.name == "readline") && debug? - ENV['HOMEBREW_NO_READLINE'] = '1' - end - end - def check_conflicts return if ARGV.force? @@ -210,8 +202,6 @@ class FormulaInstaller end def compute_and_install_dependencies - perform_readline_hack - req_map, req_deps = expand_requirements check_requirements(req_map) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index f8085ac8f1..16b2284323 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -314,7 +314,7 @@ module GitHub extend self # This is a no-op if the user is opting out of using the GitHub API. return if ENV['HOMEBREW_NO_GITHUB_API'] - safely_load_net_https + require "net/https" default_headers = { "User-Agent" => HOMEBREW_USER_AGENT, @@ -411,24 +411,4 @@ module GitHub extend self uri = URI.parse("https://api.github.com/repos/#{user}/#{repo}") open(uri) { |json| json["private"] } end - - private - - # If the zlib formula is loaded, TypeError will be raised when we try to load - # net/https. This monkeypatch prevents that and lets Net::HTTP fall back to - # the non-gzip codepath. - def safely_load_net_https - return if defined?(Net::HTTP) - if defined?(Zlib) && RUBY_VERSION >= "1.9" - require "net/protocol" - http = Class.new(Net::Protocol) do - def self.require(lib) - raise LoadError if lib == "zlib" - super - end - end - Net.const_set(:HTTP, http) - end - require "net/https" - end end