Răsfoiți Sursa

Merge pull request #1296 from MasterEnoc/fixLatestVersion

Fix get_latest_version procedure that were showing bad information
Simon Legner 5 ani în urmă
părinte
comite
5f2105a93b

+ 2 - 2
lib/docs/scrapers/apache.rb

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

+ 2 - 2
lib/docs/scrapers/cakephp.rb

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

+ 1 - 1
lib/docs/scrapers/markdown.rb

@@ -2,7 +2,7 @@ module Docs
   class Markdown < UrlScraper
     self.name = 'Markdown'
     self.type = 'simple'
-    self.base_url = 'http://daringfireball.net/projects/markdown/syntax'
+    self.base_url = 'https://daringfireball.net/projects/markdown/syntax'
 
     html_filters.push 'markdown/clean_html', 'markdown/entries'
 

+ 2 - 1
lib/docs/scrapers/rdoc/rails.rb

@@ -108,7 +108,8 @@ module Docs
     end
 
     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