History

Merge pull request #2019 from ClasherKasten/fix/update-checks

Simon Legner committed 3 years ago

Commit a757d412 parents ffcb1f1 2943d697 files · +9 −9Browse files

Unified · Split

7 files
  1. lib/docs/core/scraper.rb +1 −1
  2. lib/docs/scrapers/cppref/cppref.rb +1 −1
  3. lib/docs/scrapers/docker.rb +1 −1
  4. lib/docs/scrapers/electron.rb +1 −1
  5. lib/docs/scrapers/gnu/gcc.rb +2 −2
  6. lib/docs/scrapers/gnu/gnu_fortran.rb +2 −2
  7. lib/docs/scrapers/react_bootstrap.rb +1 −1
lib/docs/core/scraper.rb+1−1
@@ -150,7 +150,7 @@ module Docs · 149 unmodified lines
150 if path.empty? || path == '/'150 if path.empty? || path == '/'
151 root_url.to_s151 root_url.to_s
152 else152 else
153 File.join(base_url.to_s, path)153 File.join(base_url.to_s, path.to_s)
154 end154 end
155 end155 end
156 156
lib/docs/scrapers/cppref/cppref.rb+1−1
@@ -23,7 +23,7 @@ module Docs · 22 unmodified lines
23 23
24 # Check if the 'headers' page has changed24 # Check if the 'headers' page has changed
25 def get_latest_version(opts)25 def get_latest_version(opts)
26 doc = fetch_doc(self.base_url + self.root_path, opts)26 doc = fetch_doc((self.base_url + self.root_path).to_s, opts)
27 date = doc.at_css('#footer-info-lastmod').content27 date = doc.at_css('#footer-info-lastmod').content
28 date = date.match(/[[:digit:]]{1,2} .* [[:digit:]]{4}/).to_s28 date = date.match(/[[:digit:]]{1,2} .* [[:digit:]]{4}/).to_s
29 date = DateTime.strptime(date, '%e %B %Y').to_time.to_i29 date = DateTime.strptime(date, '%e %B %Y').to_time.to_i
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 > h1[id^="version-"]').content.strip99 latest_version = doc.at_css('.content > section > h2').content.strip
100 latest_version.rpartition(' ')[-1]100 latest_version.rpartition(' ')[-1]
101 end101 end
102 end102 end
lib/docs/scrapers/electron.rb+1−1
@@ -27,7 +27,7 @@ module Docs · 26 unmodified lines
27 27
28 def get_latest_version(opts)28 def get_latest_version(opts)
29 doc = fetch_doc('https://www.electronjs.org/releases/stable', opts)29 doc = fetch_doc('https://www.electronjs.org/releases/stable', opts)
30 doc.at_css(".tag").content.gsub!(/[a-zA-Z]/, '')30 doc.at_css('.release-card__metadata>a')['href'].gsub!(/[a-zA-Z\/:]/, '')[1..-1]
31 end31 end
32 end32 end
33end33end
lib/docs/scrapers/gnu/gcc.rb+2−2
@@ -156,8 +156,8 @@ module Docs · 155 unmodified lines
156 156
157 def get_latest_version(opts)157 def get_latest_version(opts)
158 doc = fetch_doc('https://gcc.gnu.org/onlinedocs/', opts)158 doc = fetch_doc('https://gcc.gnu.org/onlinedocs/', opts)
159 label = doc.at_css('ul > li > ul > li > a').content.strip159 label = doc.at_css('details > ul > li > a')['href'].strip
160 label.scan(/([0-9.]+)/)[0][0]160 label.scan(/([0-9.]+)/)[2..-1][0][0]
161 end161 end
162 end162 end
163end163end
lib/docs/scrapers/gnu/gnu_fortran.rb+2−2
@@ -53,8 +53,8 @@ module Docs · 52 unmodified lines
53 53
54 def get_latest_version(opts)54 def get_latest_version(opts)
55 doc = fetch_doc('https://gcc.gnu.org/onlinedocs/', opts)55 doc = fetch_doc('https://gcc.gnu.org/onlinedocs/', opts)
56 label = doc.at_css('ul > li > ul > li > a').content.strip56 label = doc.at_css('details > ul > li > a')['href'].strip
57 label.scan(/([0-9.]+)/)[0][0]57 label.scan(/([0-9.]+)/)[2..-1][0][0]
58 end58 end
59 end59 end
60end60end
lib/docs/scrapers/react_bootstrap.rb+1−1
@@ -29,7 +29,7 @@ module Docs · 28 unmodified lines
29 29
30 def get_latest_version(opts)30 def get_latest_version(opts)
31 doc = fetch_doc('https://react-bootstrap.github.io/', opts)31 doc = fetch_doc('https://react-bootstrap.github.io/', opts)
32 doc.at_css('#t-version>a').content.split()[0].strip[1..-1]32 doc.at_css('.my-2').content.split()[-1].strip[0..-1]
33 end33 end
34 end34 end
35end35end