History

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

Fix broken version checks

Simon Legner committed 2 years ago

Commit d7e3e912 parents 6d2f4e6 c3629436 files · +8 −8Browse files

Unified · Split

6 files
  1. lib/docs/scrapers/crystal.rb +1 −1
  2. lib/docs/scrapers/docker.rb +1 −1
  3. lib/docs/scrapers/node.rb +2 −2
  4. lib/docs/scrapers/octave.rb +1 −1
  5. lib/docs/scrapers/phalcon.rb +2 −2
  6. lib/docs/scrapers/sanctuary_type_classes.rb +1 −1
lib/docs/scrapers/crystal.rb+1−1
@@ -36,7 +36,7 @@ module Docs · 35 unmodified lines
36 36
37 def get_latest_version(opts)37 def get_latest_version(opts)
38 doc = fetch_doc('https://crystal-lang.org/', opts)38 doc = fetch_doc('https://crystal-lang.org/', opts)
39 doc.at_css('.latest-release').content.scan(/([0-9.]+)/)[0][0]39 doc.at_css('.latest-release-info > a > strong').content.scan(/([0-9.]+)/)[0][0]
40 end40 end
41 end41 end
42end42end
lib/docs/scrapers/docker.rb+1−1
@@ -96,7 +96,7 @@ module Docs · 95 unmodified lines
96 96
97 def get_latest_version(opts)97 def get_latest_version(opts)
98 doc = fetch_doc('https://docs.docker.com/engine/release-notes/', opts)98 doc = fetch_doc('https://docs.docker.com/engine/release-notes/', opts)
99 latest_version = doc.at_css('.content > section > h2').content.strip99 latest_version = doc.at_css('.DocSearch-content > h2 > a').content.strip
100 latest_version.rpartition(' ')[-1]100 latest_version.rpartition(' ')[-1]
101 end101 end
102 end102 end
lib/docs/scrapers/node.rb+2−2
@@ -74,8 +74,8 @@ module Docs · 73 unmodified lines
74 end74 end
75 75
76 def get_latest_version(opts)76 def get_latest_version(opts)
77 doc = fetch_doc('https://nodejs.org/en/', opts)77 tags = get_github_tags('nodejs', 'node', opts)
78 doc.at_css('#home-intro > .home-downloadblock:last-of-type > a')['data-version'][1..-1]78 tags[0]['name'][1..-1]
79 end79 end
80 end80 end
81end81end
lib/docs/scrapers/octave.rb+1−1
@@ -51,7 +51,7 @@ module Docs · 50 unmodified lines
51 51
52 def get_latest_version(opts)52 def get_latest_version(opts)
53 doc = fetch_doc('https://octave.org/doc/interpreter/', opts)53 doc = fetch_doc('https://octave.org/doc/interpreter/', opts)
54 doc.at_css('h1').content.scan(/([0-9.]+)/)[0][0]54 doc.at_css('#SEC_Top + p').content.scan(/([0-9.]+)/)[1][0][0..-2]
55 end55 end
56 56
57 end57 end
lib/docs/scrapers/phalcon.rb+2−2
@@ -31,8 +31,8 @@ module Docs · 30 unmodified lines
31 end31 end
32 32
33 def get_latest_version(opts)33 def get_latest_version(opts)
34 doc = fetch_doc('https://docs.phalconphp.com/', opts)34 tags = get_github_tags('phalcon', 'cphalcon', opts)
35 doc.at_css('.header__lang.expand > div > ul > li > a').content35 tags[0]['name'][1..-1]
36 end36 end
37 end37 end
38end38end
lib/docs/scrapers/sanctuary_type_classes.rb+1−1
@@ -23,7 +23,7 @@ module Docs · 22 unmodified lines
23 HTML23 HTML
24 24
25 def get_latest_version(opts)25 def get_latest_version(opts)
26 get-npm-version("sanctuary-type-classes", opts)26 get_npm_version("sanctuary-type-classes", opts)
27 end27 end
28 end28 end
29end29end

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t