Merge pull request #1294 from jmerle/fix-update-checks

Fix broken get_latest_version implementations
pull/1297/head
Simon Legner 4 years ago committed by GitHub
commit 18f5c0ac37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,8 +24,7 @@ module Docs
end
def get_latest_version(opts)
doc = fetch_doc('https://babeljs.io/docs/en/', opts)
doc.at_css('a[href="/versions"] > h3').content
get_latest_github_release('babel', 'babel', opts)
end
end
end

@ -49,8 +49,8 @@ module Docs
end
def get_latest_version(opts)
doc = fetch_doc('https://downloads.chef.io/chef', opts)
doc.at_css('h1.product-heading > span').content.strip
doc = fetch_doc('https://downloads.chef.io/products/infra', opts)
doc.at_css('#versions > option').content.strip
end
end
end

@ -40,9 +40,8 @@ module Docs
end
def get_latest_version(opts)
doc = fetch_doc('https://codeigniter.com/user_guide/changelog.html', opts)
header = doc.at_css('#change-log h2')
header.content.scan(/([0-9.]+)/)[0][0]
tags = get_github_tags('codeigniter4', 'codeigniter4', opts)
tags[0]['name'][1..-1]
end
end
end

@ -260,9 +260,9 @@ module Docs
end
def get_latest_version(opts)
doc = fetch_doc('https://docs.docker.com/', opts)
label = doc.at_css('.nav-container button.dropdown-toggle').content.strip
label.scan(/([0-9.]+)/)[0][0]
doc = fetch_doc('https://docs.docker.com/engine/release-notes/', opts)
latest_version = doc.at_css('.content > section > h1[id^="version-"]').content.strip
latest_version.rpartition(' ')[-1]
end
end
end

@ -126,7 +126,7 @@ module Docs
def get_latest_version(opts)
doc = fetch_doc('https://hexdocs.pm/elixir/api-reference.html', opts)
doc.at_css('h2.sidebar-projectVersion').content.strip[1..-1]
doc.at_css('.sidebar-projectVersion').content.strip[1..-1]
end
end
end

@ -57,8 +57,7 @@ module Docs
end
def get_latest_version(opts)
doc = fetch_doc('https://www.erlang.org/downloads', opts)
doc.at_css('.col-lg-3 > ul > li').content.strip.sub(/OTP /, '')
get_latest_github_release('erlang', 'otp', opts)[4..-1]
end
end
end

@ -54,8 +54,7 @@ module Docs
end
def get_latest_version(opts)
doc = fetch_doc('http://fishshell.com/docs/current/index.html', opts)
doc.at_css('#toc-index').content.scan(/([0-9.]+)/)[0][0]
get_latest_github_release('fish-shell', 'fish-shell', opts)
end
end
end

@ -18,9 +18,11 @@ module Docs
HTML
def get_latest_version(opts)
doc = fetch_doc('https://open-cobol.sourceforge.io/HTML/gnucobpg.html', opts)
title = doc.at_css('h1').content
title.scan(/([0-9.]+)/)[0][0]
fetch_doc('https://sourceforge.net/projects/gnucobol/files/gnucobol/', opts)
.css('#files_list > tbody > tr')
.map { |file| file['title'] }
.sort_by { |version| version.to_f }
.last
end
end
end

@ -42,6 +42,5 @@ module Docs
label = doc.at_css('h2').content.strip
label.sub(/[^0-9.]*/, '')
end
end
end

@ -44,8 +44,7 @@ module Docs
end
def get_latest_version(opts)
doc = fetch_doc('https://docs.godotengine.org/', opts)
doc.at_css('.version').content.strip
get_latest_github_release('godotengine', 'godot', opts).split('-')[0]
end
end
end

@ -48,9 +48,7 @@ module Docs
HTML
def get_latest_version(opts)
doc = fetch_doc('https://docs.influxdata.com/influxdb/', opts)
label = doc.at_css('.navbar--current-product').content.strip
label.scan(/([0-9.]+)/)[0][0]
get_latest_github_release('influxdata', 'influxdb', opts)
end
end
end

@ -24,8 +24,7 @@ module Docs
HTML
def get_latest_version(opts)
doc = fetch_doc('http://momentjs.com/', opts)
doc.at_css('.hero-title > h1 > span').content
get_github_tags('moment', 'moment', opts)[0]['name']
end
end
end

@ -46,8 +46,7 @@ module Docs
def get_latest_version(opts)
doc = fetch_doc('https://perldoc.perl.org/', opts)
header = doc.at_css('h2.h1').content
header.scan(/Perl ([0-9.]+)/)[0][0]
doc.at_css('#dropdownlink-stable').content
end
end
end

@ -68,9 +68,8 @@ module Docs
HTML
def get_latest_version(opts)
doc = fetch_doc('https://secure.php.net/manual/en/doc.changelog.php', opts)
label = doc.at_css('tbody.gen-changelog > tr > td').content
label.split(',').last.strip
doc = fetch_doc('https://www.php.net/supported-versions.php', opts)
doc.at_css('table > tbody > .stable:last-of-type > td > a').content.strip
end
end
end

@ -68,7 +68,7 @@ module Docs
def get_latest_version(opts)
doc = fetch_doc('https://docs.python.org/', opts)
doc.at_css('.version_switcher_placeholder').content
doc.at_css('title').content.split(' ')[0]
end
end
end

@ -32,8 +32,8 @@ module Docs
HTML
def get_latest_version(opts)
doc = fetch_doc('https://facebook.github.io/react-native/docs/getting-started.html', opts)
doc.at_css('header > a > h3').content
doc = fetch_doc('https://reactnative.dev/docs/getting-started', opts)
doc.at_css('meta[name="docsearch:version"]')['content']
end
end
end

@ -26,8 +26,7 @@ module Docs
HTML
def get_latest_version(opts)
doc = fetch_doc('https://scikit-learn.org/stable/documentation.html', opts)
doc.at_css('.body h1').content.scan(/([0-9.]+)/)[0][0]
get_latest_github_release('scikit-learn', 'scikit-learn', opts)
end
end
end

@ -22,8 +22,7 @@ module Docs
HTML
def get_latest_version(opts)
doc = fetch_doc('http://www.statsmodels.org/stable/', opts)
doc.at_css('.sphinxsidebarwrapper h3 + p > b').content[1..-1]
get_latest_github_release('statsmodels', 'statsmodels', opts)
end
end
end

@ -20,8 +20,7 @@ module Docs
HTML
def get_latest_version(opts)
contents = get_github_file_contents('hashicorp', 'vagrant', 'website/config.rb', opts)
contents.scan(/version\s+=\s+"([0-9.]+)"/)[0][0]
get_github_tags('hashicorp', 'vagrant', opts)[0]['name'][1..-1]
end
end
end

Loading…
Cancel
Save