Unified · Split
| @@ -132,23 +132,11 @@ module Docs · 131 unmodified lines | ||
| 132 | 132 | end |
| 133 | 133 | |
| 134 | 134 | def get_latest_version(opts) |
| 135 | − latest_version = 8 | |
| 136 | − current_attempt = latest_version | |
| 137 | − attempts = 0 | |
| 138 | − | |
| 139 | − while attempts < 3 | |
| 140 | − current_attempt += 1 | |
| 141 | − | |
| 142 | − doc = fetch_doc("https://packages.debian.org/sid/openjdk-#{current_attempt}-doc", opts) | |
| 143 | − if doc.at_css('.perror').nil? | |
| 144 | − latest_version = current_attempt | |
| 145 | − attempts = 0 | |
| 146 | − else | |
| 147 | − attempts += 1 | |
| 148 | − end | |
| 149 | − end | |
| 150 | − | |
| 151 | − latest_version | |
| 135 | + doc = fetch_doc("https://jdk.java.net/archive/", opts) | |
| 136 | + puts doc | |
| 137 | + version = doc.at_css('#downloads > table > tr > th').content | |
| 138 | + version.gsub!(/\(.*\)/, '') | |
| 139 | + version.gsub!(/[a-zA-z]/, '') | |
| 152 | 140 | end |
| 153 | 141 | end |
| 154 | 142 | end |