|
|
|
@ -132,23 +132,11 @@ module Docs
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def get_latest_version(opts)
|
|
|
|
|
latest_version = 8
|
|
|
|
|
current_attempt = latest_version
|
|
|
|
|
attempts = 0
|
|
|
|
|
|
|
|
|
|
while attempts < 3
|
|
|
|
|
current_attempt += 1
|
|
|
|
|
|
|
|
|
|
doc = fetch_doc("https://packages.debian.org/sid/openjdk-#{current_attempt}-doc", opts)
|
|
|
|
|
if doc.at_css('.perror').nil?
|
|
|
|
|
latest_version = current_attempt
|
|
|
|
|
attempts = 0
|
|
|
|
|
else
|
|
|
|
|
attempts += 1
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
latest_version
|
|
|
|
|
doc = fetch_doc("https://jdk.java.net/archive/", opts)
|
|
|
|
|
puts doc
|
|
|
|
|
version = doc.at_css('#downloads > table > tr > th').content
|
|
|
|
|
version.gsub!(/\(.*\)/, '')
|
|
|
|
|
version.gsub!(/[a-zA-z]/, '')
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|