Fix broken get_latest_version implementations
Unified · Split
| @@ -24,8 +24,7 @@ module Docs · 23 unmodified lines | |||
| 24 | end | 24 | end |
| 25 | 25 | ||
| 26 | def get_latest_version(opts) | 26 | def get_latest_version(opts) |
| 27 | doc = fetch_doc('https://babeljs.io/docs/en/', opts) | 27 | get_latest_github_release('babel', 'babel', opts) |
| 28 | doc.at_css('a[href="/versions"] > h3').content | ||
| 29 | end | 28 | end |
| 30 | end | 29 | end |
| 31 | end | 30 | end |
| @@ -49,8 +49,8 @@ module Docs · 48 unmodified lines | |||
| 49 | end | 49 | end |
| 50 | 50 | ||
| 51 | def get_latest_version(opts) | 51 | def get_latest_version(opts) |
| 52 | doc = fetch_doc('https://downloads.chef.io/chef', opts) | 52 | doc = fetch_doc('https://downloads.chef.io/products/infra', opts) |
| 53 | doc.at_css('h1.product-heading > span').content.strip | 53 | doc.at_css('#versions > option').content.strip |
| 54 | end | 54 | end |
| 55 | end | 55 | end |
| 56 | end | 56 | end |
| @@ -40,9 +40,8 @@ module Docs · 39 unmodified lines | |||
| 40 | end | 40 | end |
| 41 | 41 | ||
| 42 | def get_latest_version(opts) | 42 | def get_latest_version(opts) |
| 43 | doc = fetch_doc('https://codeigniter.com/user_guide/changelog.html', opts) | 43 | tags = get_github_tags('codeigniter4', 'codeigniter4', opts) |
| 44 | header = doc.at_css('#change-log h2') | 44 | tags[0]['name'][1..-1] |
| 45 | header.content.scan(/([0-9.]+)/)[0][0] | ||
| 46 | end | 45 | end |
| 47 | end | 46 | end |
| 48 | end | 47 | end |
| @@ -260,9 +260,9 @@ module Docs · 259 unmodified lines | |||
| 260 | end | 260 | end |
| 261 | 261 | ||
| 262 | def get_latest_version(opts) | 262 | def get_latest_version(opts) |
| 263 | doc = fetch_doc('https://docs.docker.com/', opts) | 263 | doc = fetch_doc('https://docs.docker.com/engine/release-notes/', opts) |
| 264 | label = doc.at_css('.nav-container button.dropdown-toggle').content.strip | 264 | latest_version = doc.at_css('.content > section > h1[id^="version-"]').content.strip |
| 265 | label.scan(/([0-9.]+)/)[0][0] | 265 | latest_version.rpartition(' ')[-1] |
| 266 | end | 266 | end |
| 267 | end | 267 | end |
| 268 | end | 268 | end |
| @@ -126,7 +126,7 @@ module Docs · 125 unmodified lines | |||
| 126 | 126 | ||
| 127 | def get_latest_version(opts) | 127 | def get_latest_version(opts) |
| 128 | doc = fetch_doc('https://hexdocs.pm/elixir/api-reference.html', opts) | 128 | doc = fetch_doc('https://hexdocs.pm/elixir/api-reference.html', opts) |
| 129 | doc.at_css('h2.sidebar-projectVersion').content.strip[1..-1] | 129 | doc.at_css('.sidebar-projectVersion').content.strip[1..-1] |
| 130 | end | 130 | end |
| 131 | end | 131 | end |
| 132 | end | 132 | end |
| @@ -57,8 +57,7 @@ module Docs · 56 unmodified lines | |||
| 57 | end | 57 | end |
| 58 | 58 | ||
| 59 | def get_latest_version(opts) | 59 | def get_latest_version(opts) |
| 60 | doc = fetch_doc('https://www.erlang.org/downloads', opts) | 60 | get_latest_github_release('erlang', 'otp', opts)[4..-1] |
| 61 | doc.at_css('.col-lg-3 > ul > li').content.strip.sub(/OTP /, '') | ||
| 62 | end | 61 | end |
| 63 | end | 62 | end |
| 64 | end | 63 | end |
| @@ -54,8 +54,7 @@ module Docs · 53 unmodified lines | |||
| 54 | end | 54 | end |
| 55 | 55 | ||
| 56 | def get_latest_version(opts) | 56 | def get_latest_version(opts) |
| 57 | doc = fetch_doc('http://fishshell.com/docs/current/index.html', opts) | 57 | get_latest_github_release('fish-shell', 'fish-shell', opts) |
| 58 | doc.at_css('#toc-index').content.scan(/([0-9.]+)/)[0][0] | ||
| 59 | end | 58 | end |
| 60 | end | 59 | end |
| 61 | end | 60 | end |
| @@ -18,9 +18,11 @@ module Docs · 17 unmodified lines | |||
| 18 | HTML | 18 | HTML |
| 19 | 19 | ||
| 20 | def get_latest_version(opts) | 20 | def get_latest_version(opts) |
| 21 | doc = fetch_doc('https://open-cobol.sourceforge.io/HTML/gnucobpg.html', opts) | 21 | fetch_doc('https://sourceforge.net/projects/gnucobol/files/gnucobol/', opts) |
| 22 | title = doc.at_css('h1').content | 22 | .css('#files_list > tbody > tr') |
| 23 | title.scan(/([0-9.]+)/)[0][0] | 23 | .map { |file| file['title'] } |
| 24 | .sort_by { |version| version.to_f } | ||
| 25 | .last | ||
| 24 | end | 26 | end |
| 25 | end | 27 | end |
| 26 | end | 28 | end |
| @@ -42,6 +42,5 @@ module Docs · 41 unmodified lines | |||
| 42 | label = doc.at_css('h2').content.strip | 42 | label = doc.at_css('h2').content.strip |
| 43 | label.sub(/[^0-9.]*/, '') | 43 | label.sub(/[^0-9.]*/, '') |
| 44 | end | 44 | end |
| 45 | |||
| 46 | end | 45 | end |
| 47 | end | 46 | end |
| @@ -44,8 +44,7 @@ module Docs · 43 unmodified lines | |||
| 44 | end | 44 | end |
| 45 | 45 | ||
| 46 | def get_latest_version(opts) | 46 | def get_latest_version(opts) |
| 47 | doc = fetch_doc('https://docs.godotengine.org/', opts) | 47 | get_latest_github_release('godotengine', 'godot', opts).split('-')[0] |
| 48 | doc.at_css('.version').content.strip | ||
| 49 | end | 48 | end |
| 50 | end | 49 | end |
| 51 | end | 50 | end |
| @@ -48,9 +48,7 @@ module Docs · 47 unmodified lines | |||
| 48 | HTML | 48 | HTML |
| 49 | 49 | ||
| 50 | def get_latest_version(opts) | 50 | def get_latest_version(opts) |
| 51 | doc = fetch_doc('https://docs.influxdata.com/influxdb/', opts) | 51 | get_latest_github_release('influxdata', 'influxdb', opts) |
| 52 | label = doc.at_css('.navbar--current-product').content.strip | ||
| 53 | label.scan(/([0-9.]+)/)[0][0] | ||
| 54 | end | 52 | end |
| 55 | end | 53 | end |
| 56 | end | 54 | end |
| @@ -24,8 +24,7 @@ module Docs · 23 unmodified lines | |||
| 24 | HTML | 24 | HTML |
| 25 | 25 | ||
| 26 | def get_latest_version(opts) | 26 | def get_latest_version(opts) |
| 27 | doc = fetch_doc('http://momentjs.com/', opts) | 27 | get_github_tags('moment', 'moment', opts)[0]['name'] |
| 28 | doc.at_css('.hero-title > h1 > span').content | ||
| 29 | end | 28 | end |
| 30 | end | 29 | end |
| 31 | end | 30 | end |
| @@ -46,8 +46,7 @@ module Docs · 45 unmodified lines | |||
| 46 | 46 | ||
| 47 | def get_latest_version(opts) | 47 | def get_latest_version(opts) |
| 48 | doc = fetch_doc('https://perldoc.perl.org/', opts) | 48 | doc = fetch_doc('https://perldoc.perl.org/', opts) |
| 49 | header = doc.at_css('h2.h1').content | 49 | doc.at_css('#dropdownlink-stable').content |
| 50 | header.scan(/Perl ([0-9.]+)/)[0][0] | ||
| 51 | end | 50 | end |
| 52 | end | 51 | end |
| 53 | end | 52 | end |
| @@ -68,9 +68,8 @@ module Docs · 67 unmodified lines | |||
| 68 | HTML | 68 | HTML |
| 69 | 69 | ||
| 70 | def get_latest_version(opts) | 70 | def get_latest_version(opts) |
| 71 | doc = fetch_doc('https://secure.php.net/manual/en/doc.changelog.php', opts) | 71 | doc = fetch_doc('https://www.php.net/supported-versions.php', opts) |
| 72 | label = doc.at_css('tbody.gen-changelog > tr > td').content | 72 | doc.at_css('table > tbody > .stable:last-of-type > td > a').content.strip |
| 73 | label.split(',').last.strip | ||
| 74 | end | 73 | end |
| 75 | end | 74 | end |
| 76 | end | 75 | end |
| @@ -68,7 +68,7 @@ module Docs · 67 unmodified lines | |||
| 68 | 68 | ||
| 69 | def get_latest_version(opts) | 69 | def get_latest_version(opts) |
| 70 | doc = fetch_doc('https://docs.python.org/', opts) | 70 | doc = fetch_doc('https://docs.python.org/', opts) |
| 71 | doc.at_css('.version_switcher_placeholder').content | 71 | doc.at_css('title').content.split(' ')[0] |
| 72 | end | 72 | end |
| 73 | end | 73 | end |
| 74 | end | 74 | end |
| @@ -32,8 +32,8 @@ module Docs · 31 unmodified lines | |||
| 32 | HTML | 32 | HTML |
| 33 | 33 | ||
| 34 | def get_latest_version(opts) | 34 | def get_latest_version(opts) |
| 35 | doc = fetch_doc('https://facebook.github.io/react-native/docs/getting-started.html', opts) | 35 | doc = fetch_doc('https://reactnative.dev/docs/getting-started', opts) |
| 36 | doc.at_css('header > a > h3').content | 36 | doc.at_css('meta[name="docsearch:version"]')['content'] |
| 37 | end | 37 | end |
| 38 | end | 38 | end |
| 39 | end | 39 | end |
| @@ -26,8 +26,7 @@ module Docs · 25 unmodified lines | |||
| 26 | HTML | 26 | HTML |
| 27 | 27 | ||
| 28 | def get_latest_version(opts) | 28 | def get_latest_version(opts) |
| 29 | doc = fetch_doc('https://scikit-learn.org/stable/documentation.html', opts) | 29 | get_latest_github_release('scikit-learn', 'scikit-learn', opts) |
| 30 | doc.at_css('.body h1').content.scan(/([0-9.]+)/)[0][0] | ||
| 31 | end | 30 | end |
| 32 | end | 31 | end |
| 33 | end | 32 | end |
| @@ -22,8 +22,7 @@ module Docs · 21 unmodified lines | |||
| 22 | HTML | 22 | HTML |
| 23 | 23 | ||
| 24 | def get_latest_version(opts) | 24 | def get_latest_version(opts) |
| 25 | doc = fetch_doc('http://www.statsmodels.org/stable/', opts) | 25 | get_latest_github_release('statsmodels', 'statsmodels', opts) |
| 26 | doc.at_css('.sphinxsidebarwrapper h3 + p > b').content[1..-1] | ||
| 27 | end | 26 | end |
| 28 | end | 27 | end |
| 29 | end | 28 | end |
| @@ -20,8 +20,7 @@ module Docs · 19 unmodified lines | |||
| 20 | HTML | 20 | HTML |
| 21 | 21 | ||
| 22 | def get_latest_version(opts) | 22 | def get_latest_version(opts) |
| 23 | contents = get_github_file_contents('hashicorp', 'vagrant', 'website/config.rb', opts) | 23 | get_github_tags('hashicorp', 'vagrant', opts)[0]['name'][1..-1] |
| 24 | contents.scan(/version\s+=\s+"([0-9.]+)"/)[0][0] | ||
| 25 | end | 24 | end |
| 26 | end | 25 | end |
| 27 | end | 26 | end |