1
0
Эх сурвалжийг харах

Merge pull request #2196 from ClasherKasten/fix/broken-version-checks

Fix broken version checks
Simon Legner 1 жил өмнө
parent
commit
d7e3e914c6

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

@@ -36,7 +36,7 @@ module Docs
 
     def get_latest_version(opts)
       doc = fetch_doc('https://crystal-lang.org/', opts)
-      doc.at_css('.latest-release').content.scan(/([0-9.]+)/)[0][0]
+      doc.at_css('.latest-release-info > a > strong').content.scan(/([0-9.]+)/)[0][0]
     end
   end
 end

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

@@ -96,7 +96,7 @@ module Docs
 
     def get_latest_version(opts)
       doc = fetch_doc('https://docs.docker.com/engine/release-notes/', opts)
-      latest_version = doc.at_css('.content > section > h2').content.strip
+      latest_version = doc.at_css('.DocSearch-content > h2 > a').content.strip
       latest_version.rpartition(' ')[-1]
     end
   end

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

@@ -74,8 +74,8 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://nodejs.org/en/', opts)
-      doc.at_css('#home-intro > .home-downloadblock:last-of-type > a')['data-version'][1..-1]
+      tags = get_github_tags('nodejs', 'node', opts)
+      tags[0]['name'][1..-1]
     end
   end
 end

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

@@ -51,7 +51,7 @@ module Docs
 
     def get_latest_version(opts)
       doc = fetch_doc('https://octave.org/doc/interpreter/', opts)
-      doc.at_css('h1').content.scan(/([0-9.]+)/)[0][0]
+      doc.at_css('#SEC_Top + p').content.scan(/([0-9.]+)/)[1][0][0..-2]
     end
 
   end

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

@@ -31,8 +31,8 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://docs.phalconphp.com/', opts)
-      doc.at_css('.header__lang.expand > div > ul > li > a').content
+      tags = get_github_tags('phalcon', 'cphalcon', opts)
+      tags[0]['name'][1..-1]
     end
   end
 end

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

@@ -23,7 +23,7 @@ module Docs
     HTML
 
     def get_latest_version(opts)
-      get-npm-version("sanctuary-type-classes", opts)
+      get_npm_version("sanctuary-type-classes", opts)
     end
   end
 end