aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorJack Nagel2015-01-01 01:21:59 -0500
committerJack Nagel2015-01-03 22:39:07 -0500
commit0169cc741260351a794a22aaffd1dff4a2e7cace (patch)
tree27ad881c4b76591783f3688dcfabad00aa02b84f /Library/Homebrew/utils.rb
parent6cfaaa2a3c98b179d62f7773f520ad5a3a6df036 (diff)
downloadhomebrew-0169cc741260351a794a22aaffd1dff4a2e7cace.tar.bz2
Remove readline and zlib hacks
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb22
1 files changed, 1 insertions, 21 deletions
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