cask-pr-manual-check: use uri.read in json.parse

This commit is contained in:
Vítor Galvão
2020-02-22 13:44:37 +00:00
committed by GitHub
parent 495c7fc023
commit 916c813c63
+1 -1
View File
@@ -10,7 +10,7 @@ abort 'You need to give the script exactly one argument, the URL to a pull reque
abort 'URL is not from an official Homebrew Cask tap' if pr_url !~ %r{^https://github.com/Homebrew/homebrew-cask.*}
pr_api = pr_url.sub(%r{^https://github.com/([^/]+)/([^/]+)/pull/([^/]+).*}, 'https://api.github.com/repos/\1/\2/pulls/\3/files')
pr_json = JSON.parse(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