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
35 HTML35 HTML
36 36
37 def get_latest_version(opts)37 def get_latest_version(opts)
38 doc = fetch_doc('http://httpd.apache.org/docs/', opts)38 doc = fetch_doc('http://httpd.apache.org/download', opts)
39 doc.at_css('#apcontents > ul a')['href'][0...-1]39 doc.at_css('#apcontents li > a').content
40 end40 end
41 end41 end
42end42end
lib/docs/scrapers/cakephp.rb+2−2
@@ -82,8 +82,8 @@ module Docs · 81 unmodified lines
82 end82 end
83 83
84 def get_latest_version(opts)84 def get_latest_version(opts)
85 doc = fetch_doc('https://api.cakephp.org/3.7/', opts)85 doc = fetch_doc('https://cakephp.org', opts)
86 doc.at_css('.version-picker .dropdown-toggle').content.strip86 doc.at_css('.title-home h1').content.scan(/\d\.\d*\.*\d*\.*\d*\.*/)[0]
87 end87 end
88 88
89 private89 private
lib/docs/scrapers/markdown.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Markdown < UrlScraper2 class Markdown < UrlScraper
3 self.name = 'Markdown'3 self.name = 'Markdown'
4 self.type = 'simple'4 self.type = 'simple'
5 self.base_url = 'http://daringfireball.net/projects/markdown/syntax'5 self.base_url = 'https://daringfireball.net/projects/markdown/syntax'
6 6
7 html_filters.push 'markdown/clean_html', 'markdown/entries'7 html_filters.push 'markdown/clean_html', 'markdown/entries'
8 8
lib/docs/scrapers/rdoc/rails.rb+2−1
@@ -108,7 +108,8 @@ module Docs · 107 unmodified lines
108 end108 end
109 109
110 def get_latest_version(opts)110 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]
112 end113 end
113 end114 end
114end115end