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
150150 if path.empty? || path == '/'
151151 root_url.to_s
152152 else
153− File.join(base_url.to_s, path)
153+ File.join(base_url.to_s, path.to_s)
154154 end
155155 end
156156
lib/docs/scrapers/cppref/cppref.rb+1−1
@@ -23,7 +23,7 @@ module Docs · 22 unmodified lines
2323
2424 # Check if the 'headers' page has changed
2525 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)
2727 date = doc.at_css('#footer-info-lastmod').content
2828 date = date.match(/[[:digit:]]{1,2} .* [[:digit:]]{4}/).to_s
2929 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
9696
9797 def get_latest_version(opts)
9898 doc = fetch_doc('https://docs.docker.com/engine/release-notes/', opts)
99− latest_version = doc.at_css('.content > section > h1[id^="version-"]').content.strip
99+ latest_version = doc.at_css('.content > section > h2').content.strip
100100 latest_version.rpartition(' ')[-1]
101101 end
102102 end
lib/docs/scrapers/electron.rb+1−1
@@ -27,7 +27,7 @@ module Docs · 26 unmodified lines
2727
2828 def get_latest_version(opts)
2929 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]
3131 end
3232 end
3333 end
lib/docs/scrapers/gnu/gcc.rb+2−2
@@ -156,8 +156,8 @@ module Docs · 155 unmodified lines
156156
157157 def get_latest_version(opts)
158158 doc = fetch_doc('https://gcc.gnu.org/onlinedocs/', opts)
159− label = doc.at_css('ul > li > ul > li > a').content.strip
160− label.scan(/([0-9.]+)/)[0][0]
159+ label = doc.at_css('details > ul > li > a')['href'].strip
160+ label.scan(/([0-9.]+)/)[2..-1][0][0]
161161 end
162162 end
163163 end
lib/docs/scrapers/gnu/gnu_fortran.rb+2−2
@@ -53,8 +53,8 @@ module Docs · 52 unmodified lines
5353
5454 def get_latest_version(opts)
5555 doc = fetch_doc('https://gcc.gnu.org/onlinedocs/', opts)
56− label = doc.at_css('ul > li > ul > li > a').content.strip
57− label.scan(/([0-9.]+)/)[0][0]
56+ label = doc.at_css('details > ul > li > a')['href'].strip
57+ label.scan(/([0-9.]+)/)[2..-1][0][0]
5858 end
5959 end
6060 end
lib/docs/scrapers/react_bootstrap.rb+1−1
@@ -29,7 +29,7 @@ module Docs · 28 unmodified lines
2929
3030 def get_latest_version(opts)
3131 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]
3333 end
3434 end
3535 end