Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update multiple "current version" checks #2019

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/docs/core/scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def url_for(path)
if path.empty? || path == '/'
root_url.to_s
else
File.join(base_url.to_s, path)
File.join(base_url.to_s, path.to_s)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/docs/scrapers/cppref/cppref.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Cppref < UrlScraper

# Check if the 'headers' page has changed
def get_latest_version(opts)
doc = fetch_doc(self.base_url + self.root_path, opts)
doc = fetch_doc((self.base_url + self.root_path).to_s, opts)
date = doc.at_css('#footer-info-lastmod').content
date = date.match(/[[:digit:]]{1,2} .* [[:digit:]]{4}/).to_s
date = DateTime.strptime(date, '%e %B %Y').to_time.to_i
Expand Down
2 changes: 1 addition & 1 deletion lib/docs/scrapers/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Docker < UrlScraper

def get_latest_version(opts)
doc = fetch_doc('https://docs.docker.com/engine/release-notes/', opts)
latest_version = doc.at_css('.content > section > h1[id^="version-"]').content.strip
latest_version = doc.at_css('.content > section > h2').content.strip
latest_version.rpartition(' ')[-1]
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/docs/scrapers/electron.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Electron < UrlScraper

def get_latest_version(opts)
doc = fetch_doc('https://www.electronjs.org/releases/stable', opts)
doc.at_css(".tag").content.gsub!(/[a-zA-Z]/, '')
doc.at_css('.release-card__metadata>a')['href'].gsub!(/[a-zA-Z\/:]/, '')[1..-1]
end
end
end
4 changes: 2 additions & 2 deletions lib/docs/scrapers/gnu/gcc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ class Gcc < Gnu

def get_latest_version(opts)
doc = fetch_doc('https://gcc.gnu.org/onlinedocs/', opts)
label = doc.at_css('ul > li > ul > li > a').content.strip
label.scan(/([0-9.]+)/)[0][0]
label = doc.at_css('details > ul > li > a')['href'].strip
label.scan(/([0-9.]+)/)[2..-1][0][0]
end
end
end
4 changes: 2 additions & 2 deletions lib/docs/scrapers/gnu/gnu_fortran.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class GnuFortran < Gnu

def get_latest_version(opts)
doc = fetch_doc('https://gcc.gnu.org/onlinedocs/', opts)
label = doc.at_css('ul > li > ul > li > a').content.strip
label.scan(/([0-9.]+)/)[0][0]
label = doc.at_css('details > ul > li > a')['href'].strip
label.scan(/([0-9.]+)/)[2..-1][0][0]
end
end
end
2 changes: 1 addition & 1 deletion lib/docs/scrapers/react_bootstrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ReactBootstrap < UrlScraper

def get_latest_version(opts)
doc = fetch_doc('https://react-bootstrap.github.io/', opts)
doc.at_css('#t-version>a').content.split()[0].strip[1..-1]
doc.at_css('.my-2').content.split()[-1].strip[0..-1]
end
end
end
Loading