History

Merge pull request #1296 from MasterEnoc/fixLatestVersion

Fix get_latest_version procedure that were showing bad information

Simon Legner committed 5 years ago

Commit 5f2105a2 parents b503241 5dfdd5a4 files · +7 −6Browse files

Unified · Split

4 files
  1. lib/docs/scrapers/apache.rb +2 −2
  2. lib/docs/scrapers/cakephp.rb +2 −2
  3. lib/docs/scrapers/markdown.rb +1 −1
  4. lib/docs/scrapers/rdoc/rails.rb +2 −1
lib/docs/scrapers/apache.rb+2−2
@@ -35,8 +35,8 @@ module Docs · 34 unmodified lines
3535 HTML
3636
3737 def get_latest_version(opts)
38− doc = fetch_doc('http://httpd.apache.org/docs/', opts)
39− doc.at_css('#apcontents > ul a')['href'][0...-1]
38+ doc = fetch_doc('http://httpd.apache.org/download', opts)
39+ doc.at_css('#apcontents li > a').content
4040 end
4141 end
4242 end
lib/docs/scrapers/cakephp.rb+2−2
@@ -82,8 +82,8 @@ module Docs · 81 unmodified lines
8282 end
8383
8484 def get_latest_version(opts)
85− doc = fetch_doc('https://api.cakephp.org/3.7/', opts)
86− doc.at_css('.version-picker .dropdown-toggle').content.strip
85+ doc = fetch_doc('https://cakephp.org', opts)
86+ doc.at_css('.title-home h1').content.scan(/\d\.\d*\.*\d*\.*\d*\.*/)[0]
8787 end
8888
8989 private
lib/docs/scrapers/markdown.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class Markdown < UrlScraper
33 self.name = 'Markdown'
44 self.type = 'simple'
5− self.base_url = 'http://daringfireball.net/projects/markdown/syntax'
5+ self.base_url = 'https://daringfireball.net/projects/markdown/syntax'
66
77 html_filters.push 'markdown/clean_html', 'markdown/entries'
88
lib/docs/scrapers/rdoc/rails.rb+2−1
@@ -108,7 +108,8 @@ module Docs · 107 unmodified lines
108108 end
109109
110110 def get_latest_version(opts)
111− get_latest_github_release('rails', 'rails', opts)
111+ doc = fetch_doc('https://rubyonrails.org/', opts)
112+ doc.at_css('.version p a').content.scan(/\d\.\d*\.*\d*\.*\d*/)[0]
112113 end
113114 end
114115 end