Fix get_latest_version procedure that were showing bad information

- markdown: update scraper and fix get_latest_version

- rails: fix get_latest_version, it was showing an outdated
  version as the latest version

- apache: fix get_latest_version, it was showing and
  outdated version as the latest version

- cakephp: fix get_latest_version, it was showing and
  outdated version as the latest version
pull/1296/head
MasterEnoc 4 years ago
parent ba0d9f5d41
commit 4ab95dc382

@ -35,8 +35,8 @@ module Docs
HTML HTML
def get_latest_version(opts) def get_latest_version(opts)
doc = fetch_doc('http://httpd.apache.org/docs/', opts) doc = fetch_doc('http://httpd.apache.org/download', opts)
doc.at_css('#apcontents > ul a')['href'][0...-1] doc.at_css('#apcontents li > a').content
end end
end end
end end

@ -82,8 +82,8 @@ module Docs
end end
def get_latest_version(opts) def get_latest_version(opts)
doc = fetch_doc('https://api.cakephp.org/3.7/', opts) doc = fetch_doc('https://cakephp.org', opts)
doc.at_css('.version-picker .dropdown-toggle').content.strip doc.at_css('.title-home h1').content.scan(/\d\.\d*\.*\d*\.*\d*\.*/)[0]
end end
private private

@ -2,7 +2,8 @@ module Docs
class Markdown < UrlScraper class Markdown < UrlScraper
self.name = 'Markdown' self.name = 'Markdown'
self.type = 'simple' self.type = 'simple'
self.base_url = 'http://daringfireball.net/projects/markdown/syntax' self.release = '1.0.1'
self.base_url = 'https://daringfireball.net/projects/markdown/syntax'
html_filters.push 'markdown/clean_html', 'markdown/entries' html_filters.push 'markdown/clean_html', 'markdown/entries'
@ -15,7 +16,8 @@ module Docs
HTML HTML
def get_latest_version(opts) def get_latest_version(opts)
'1.0.0' doc = fetch_doc('http://daringfireball.net/projects/markdown', opts)
doc.at_css('.article p a').content.scan(/\d\.\d*\.*\d*\.*\d*\.*/)[0]
end end
end end
end end

@ -108,7 +108,8 @@ module Docs
end end
def get_latest_version(opts) def get_latest_version(opts)
get_latest_github_release('rails', 'rails', opts) doc = fetch_doc('https://rubyonrails.org/', opts)
doc.at_css('.version p a').content.scan(/\d\.\d*\.*\d*\.*\d*/)[0]
end end
end end
end end

Loading…
Cancel
Save