aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2015-01-01 01:21:59 -0500
committerJack Nagel2015-01-03 22:39:07 -0500
commita52143c63c771db1ce4eaee23022696b4519be03 (patch)
treeaaad7af0c06287a47a995659c5ae9d056a9ce31b
parenta2a24b3a0da6272a4f24828a40e3d70bd948e7af (diff)
downloadbrew-a52143c63c771db1ce4eaee23022696b4519be03.tar.bz2
Remove readline and zlib hacks
-rw-r--r--Library/Homebrew/debrew.rb27
-rw-r--r--Library/Homebrew/formula_installer.rb10
-rw-r--r--Library/Homebrew/utils.rb22
3 files changed, 13 insertions, 46 deletions
diff --git a/Library/Homebrew/debrew.rb b/Library/Homebrew/debrew.rb
index 4a48d7090..b1f14b141 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
- }
-
- return :ignore
- end if Ignorable === e
- 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
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 3515c66de..b37b65fe6 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 f8085ac8f..16b228432 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