utils/curl: fix Rubocop warnings.

This commit is contained in:
Mike McQuaid 2016-09-11 17:47:04 +01:00
parent 56b6c43686
commit 3bf5e779ab

View File

@ -1,7 +1,7 @@
require "pathname" require "pathname"
require "open3" require "open3"
def curl_args(extra_args=[]) def curl_args(extra_args = [])
curl = Pathname.new ENV["HOMEBREW_CURL"] curl = Pathname.new ENV["HOMEBREW_CURL"]
curl = Pathname.new "/usr/bin/curl" unless curl.exist? curl = Pathname.new "/usr/bin/curl" unless curl.exist?
raise "#{curl} is not executable" unless curl.exist? && curl.executable? raise "#{curl} is not executable" unless curl.exist? && curl.executable?
@ -9,7 +9,7 @@ def curl_args(extra_args=[])
flags = HOMEBREW_CURL_ARGS flags = HOMEBREW_CURL_ARGS
flags -= ["--progress-bar"] if ARGV.verbose? flags -= ["--progress-bar"] if ARGV.verbose?
args = ["#{curl}"] + flags + extra_args args = [curl.to_s] + flags + extra_args
args << "--verbose" if ENV["HOMEBREW_CURL_VERBOSE"] args << "--verbose" if ENV["HOMEBREW_CURL_VERBOSE"]
args << "--silent" if !$stdout.tty? || ENV["TRAVIS"] args << "--silent" if !$stdout.tty? || ENV["TRAVIS"]
args args