Skip to content

Commit 48a7451

Browse files
authored
Merge pull request #2623 from spamguy/electron-releases
Update get_latest_version algorithms
2 parents 6866bda + d74e93b commit 48a7451

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

lib/docs/scrapers/electron.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ class Electron < UrlScraper
2626
HTML
2727

2828
def get_latest_version(opts)
29-
doc = fetch_doc('https://www.electronjs.org/releases/stable', opts)
30-
doc.at_css('.release-card__metadata>a')['href'].gsub!(/[a-zA-Z\/:]/, '')[1..-1]
29+
get_latest_github_release('electron', 'electron', opts)
3130
end
3231
end
3332
end

lib/docs/scrapers/nix.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Nix < UrlScraper
2323

2424
def get_latest_version(opts)
2525
doc = fetch_doc('https://nixos.org/manual/nix/stable/', opts)
26-
doc.at_css('a.active')['href'].scan(/([0-9.]+)/)[0][0]
26+
doc.at_css('h1.menu-title').content.scan(/([0-9.]+)/).first.first
2727
end
2828
end
2929
end

lib/docs/scrapers/redis.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ class Redis < UrlScraper
2121
HTML
2222

2323
def get_latest_version(opts)
24-
body = fetch('http://download.redis.io/redis-stable/00-RELEASENOTES', opts)
25-
body.scan(/Redis Community Edition ([0-9.]+)/)[0][0]
24+
get_latest_github_release('redis', 'redis', opts)
2625
end
2726

2827
private

0 commit comments

Comments
 (0)