diff options
| author | Gautham Goli | 2017-10-12 00:29:19 +0530 |
|---|---|---|
| committer | Gautham Goli | 2017-10-13 19:50:46 +0530 |
| commit | 7fa51f71f1a8a21b905bafc1fb4106f0222d654f (patch) | |
| tree | 098d2477a8262a5770310fed4693da31c4392e1c /Library/Homebrew/dev-cmd/pull.rb | |
| parent | afdd0e2437426ec85ff86e5b7562d3a6a69ba3e5 (diff) | |
| parent | 56458f03fcc68ef6d8ee3ee4a7c1d16021aa5800 (diff) | |
| download | brew-7fa51f71f1a8a21b905bafc1fb4106f0222d654f.tar.bz2 | |
Merge branch 'master' into audit_line_rubocop_part_4_rebase_attempt_1
Diffstat (limited to 'Library/Homebrew/dev-cmd/pull.rb')
| -rw-r--r-- | Library/Homebrew/dev-cmd/pull.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb index 9681bb2bc..8cb270303 100644 --- a/Library/Homebrew/dev-cmd/pull.rb +++ b/Library/Homebrew/dev-cmd/pull.rb @@ -69,13 +69,13 @@ module Homebrew tap = nil ARGV.named.each do |arg| - if arg.to_i > 0 + if arg.to_i.positive? issue = arg url = "https://github.com/Homebrew/homebrew-core/pull/#{arg}" tap = CoreTap.instance elsif (testing_match = arg.match %r{/job/Homebrew.*Testing/(\d+)/}) tap = ARGV.value("tap") - tap = if tap && tap.start_with?("homebrew/") + tap = if tap&.start_with?("homebrew/") Tap.fetch("homebrew", tap.strip_prefix("homebrew/")) elsif tap odie "Tap option did not start with \"homebrew/\": #{tap}" @@ -154,8 +154,8 @@ module Homebrew begin f = Formula[name] - # Make sure we catch syntax errors. - rescue Exception + rescue Exception # rubocop:disable Lint/RescueException + # Make sure we catch syntax errors. next end @@ -228,7 +228,7 @@ module Homebrew "https://github.com/BrewTestBot/homebrew-#{tap.repo}/compare/homebrew:master...pr-#{issue}" end - curl "--silent", "--fail", "-o", "/dev/null", "-I", bottle_commit_url + curl "--silent", "--fail", "--output", "/dev/null", "--head", bottle_commit_url safe_system "git", "checkout", "--quiet", "-B", bottle_branch, orig_revision pull_patch bottle_commit_url, "bottle commit" @@ -303,7 +303,7 @@ module Homebrew extra_msg = @description ? "(#{@description})" : nil ohai "Fetching patch #{extra_msg}" puts "Patch: #{patch_url}" - curl patch_url, "-s", "-o", patchpath + curl_download patch_url, to: patchpath end def apply_patch @@ -350,7 +350,7 @@ module Homebrew files << Regexp.last_match(1) if line =~ %r{^\+\+\+ b/(.*)} end files.each do |file| - if tap && tap.formula_file?(file) + if tap&.formula_file?(file) formula_name = File.basename(file, ".rb") formulae << formula_name unless formulae.include?(formula_name) else @@ -433,10 +433,10 @@ module Homebrew end version = info.pkg_version ohai "Publishing on Bintray: #{package} #{version}" - curl "-w", '\n', "--silent", "--fail", - "-u#{creds[:user]}:#{creds[:key]}", "-X", "POST", - "-H", "Content-Type: application/json", - "-d", '{"publish_wait_for_secs": 0}', + curl "--write-out", '\n', "--silent", "--fail", + "--user", "#{creds[:user]}:#{creds[:key]}", "--request", "POST", + "--header", "Content-Type: application/json", + "--data", '{"publish_wait_for_secs": 0}', "https://api.bintray.com/content/homebrew/#{repo}/#{package}/#{version}/publish" true rescue => e @@ -587,7 +587,7 @@ module Homebrew # We're in the cache; make sure to force re-download loop do begin - curl url, "-o", filename + curl_download url, continue_at: 0, to: filename break rescue if retry_count >= max_curl_retries @@ -606,7 +606,7 @@ module Homebrew end def check_bintray_mirror(name, url) - headers = curl_output("--connect-timeout", "15", "--head", url)[0] + headers, = curl_output("--connect-timeout", "15", "--location", "--head", url) status_code = headers.scan(%r{^HTTP\/.* (\d+)}).last.first return if status_code.start_with?("2") opoo "The Bintray mirror #{url} is not reachable (HTTP status code #{status_code})." |
