From 410981fbec9ebad1d12e38b29339ffdab23c5c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Galv=C3=A3o?= Date: Tue, 10 Nov 2020 17:11:04 +0000 Subject: [PATCH] cask-pr-inspect-download: remove open from URI (#92322) --- developer/bin/cask-pr-inspect-download | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/developer/bin/cask-pr-inspect-download b/developer/bin/cask-pr-inspect-download index f6da054999..5173e40ea0 100755 --- a/developer/bin/cask-pr-inspect-download +++ b/developer/bin/cask-pr-inspect-download @@ -35,7 +35,7 @@ end pr_api = pr_url.sub(%r{^https://github.com/([^/]+)/([^/]+)/pull/([^/]+).*}, 'https://api.github.com/repos/\1/\2/pulls/\3/files') -pr_json = JSON.parse(URI.open(pr_api).read) +pr_json = JSON.parse(URI(pr_api).read) abort "PR needs to have a single file" if pr_json.count != 1 @@ -46,7 +46,7 @@ tmp_cache_dir = Dir.mktmpdir tmp_download_dir = File.join(tmp_cache_dir, "downloads") ENV["HOMEBREW_CACHE"] = tmp_cache_dir -File.write(local_file, URI.open(file_raw_url).read) +File.write(local_file, URI(file_raw_url).read) system("brew", "cask", "fetch", local_file) downloaded_file = File.join(tmp_download_dir, Dir.children(tmp_download_dir).first)