Skip to content
Open
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
7 changes: 5 additions & 2 deletions lib/docs/scrapers/electron.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ class Electron < UrlScraper
HTML

def get_latest_version(opts)
doc = fetch_doc('https://www.electronjs.org/releases/stable', opts)
doc.at_css('.release-card__metadata>a')['href'].gsub!(/[a-zA-Z\/:]/, '')[1..-1]
doc = fetch_doc('https://releases.electronjs.org/release?channel=stable', opts)

# Builds are sorted by build time, not latest version. Manually sort rows by version.
# This list is paginated; it is assumed the latest version is somewhere on the first page.
doc.css('table.w-full > tbody > tr td:first-child').map(&:content).sort!.last
end
end
end
2 changes: 1 addition & 1 deletion lib/docs/scrapers/nix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Nix < UrlScraper

def get_latest_version(opts)
doc = fetch_doc('https://nixos.org/manual/nix/stable/', opts)
doc.at_css('a.active')['href'].scan(/([0-9.]+)/)[0][0]
doc.at_css('h1.menu-title').content.scan(/([0-9.]+)/).first.first
end
end
end
2 changes: 1 addition & 1 deletion lib/docs/scrapers/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Redis < UrlScraper

def get_latest_version(opts)
body = fetch('http://download.redis.io/redis-stable/00-RELEASENOTES', opts)
body.scan(/Redis Community Edition ([0-9.]+)/)[0][0]
body.scan(/^Redis ([0-9.]+)\s+Released/).first.first
end

private
Expand Down