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

This commit is contained in:
Vítor Galvão 2020-11-10 17:11:04 +00:00 committed by GitHub
parent 66f3b6d60e
commit 410981fbec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

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)