utils/repology: temporarily disable functionality.
Doesn't work with system `curl` currently.
This commit is contained in:
parent
5a5db3ab96
commit
1680ddb267
@ -14,8 +14,11 @@ describe Repology do
|
|||||||
it "returns a hash for existing package" do
|
it "returns a hash for existing package" do
|
||||||
response = described_class.single_package_query("openclonk", repository: "homebrew")
|
response = described_class.single_package_query("openclonk", repository: "homebrew")
|
||||||
|
|
||||||
expect(response).not_to be_nil
|
expect(response).to be_nil
|
||||||
expect(response).to be_a(Hash)
|
# TODO: uncomment (and remove line above) when we have a fix for Repology
|
||||||
|
# `curl` issues
|
||||||
|
# expect(response).not_to be_nil
|
||||||
|
# expect(response).to be_a(Hash)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -15,26 +15,30 @@ module Repology
|
|||||||
MAX_PAGINATION = 15
|
MAX_PAGINATION = 15
|
||||||
private_constant :MAX_PAGINATION
|
private_constant :MAX_PAGINATION
|
||||||
|
|
||||||
def query_api(last_package_in_response = "", repository:)
|
def query_api(_last_package_in_response = "", repository:)
|
||||||
last_package_in_response += "/" if last_package_in_response.present?
|
{}
|
||||||
url = "https://repology.org/api/v1/projects/#{last_package_in_response}?inrepo=#{repository}&outdated=1"
|
# TODO: uncomment (and remove lines above) when we have a fix for Repology
|
||||||
|
# `curl` issues
|
||||||
|
# last_package_in_response += "/" if last_package_in_response.present?
|
||||||
|
# url = "https://repology.org/api/v1/projects/#{last_package_in_response}?inrepo=#{repository}&outdated=1"
|
||||||
|
|
||||||
output, _errors, _status = curl_output(url.to_s)
|
# output, _errors, _status = curl_output(url.to_s)
|
||||||
JSON.parse(output)
|
# JSON.parse(output)
|
||||||
end
|
end
|
||||||
|
|
||||||
def single_package_query(name, repository:)
|
def single_package_query(name, repository:)
|
||||||
url = "https://repology.org/tools/project-by?repo=#{repository}&" \
|
# TODO: uncomment when we have a fix for Repology `curl` issues
|
||||||
"name_type=srcname&target_page=api_v1_project&name=#{name}"
|
# url = "https://repology.org/tools/project-by?repo=#{repository}&" \
|
||||||
|
# "name_type=srcname&target_page=api_v1_project&name=#{name}"
|
||||||
|
|
||||||
output, _errors, _status = curl_output("--location", url.to_s)
|
# output, _errors, _status = curl_output("--location", url.to_s)
|
||||||
|
|
||||||
begin
|
# begin
|
||||||
data = JSON.parse(output)
|
# data = JSON.parse(output)
|
||||||
{ name => data }
|
# { name => data }
|
||||||
rescue
|
# rescue
|
||||||
nil
|
# nil
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_api_response(limit = nil, repository:)
|
def parse_api_response(limit = nil, repository:)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user