cask-pr-inspect-download: remove open from URI (#92322)

This commit is contained in:
Vítor Galvão
2020-11-10 18:11:04 +01:00
committed by GitHub
parent 66f3b6d60e
commit 410981fbec
+2 -2
View File
@@ -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)