Fix curlrc existence check

Enumerable#one? is not available under Ruby 1.8.6. Further, we really
want #any? here, as setting both HOME and CURL_HOME can trigger a false
negative.

Fixes Homebrew/homebrew#15883.
This commit is contained in:
Jack Nagel 2012-11-06 19:00:54 -06:00
parent 45e208d26b
commit 1cb59ea5fd

View File

@ -484,7 +484,7 @@ def check_user_path_3
end end
def check_user_curlrc def check_user_curlrc
if %w[CURL_HOME HOME].one?{|key| ENV[key] and File.exists? "#{ENV[key]}/.curlrc" } then <<-EOS.undent if %w[CURL_HOME HOME].any?{|key| ENV[key] and File.exists? "#{ENV[key]}/.curlrc" } then <<-EOS.undent
You have a curlrc file You have a curlrc file
If you have trouble downloading packages with Homebrew, then maybe this If you have trouble downloading packages with Homebrew, then maybe this
is the problem? If the following command doesn't work, then try removing is the problem? If the following command doesn't work, then try removing