Skip to content
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/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('.DocSearch-content > h2 > a').content.strip
latest_version = doc.at_css('h2.scroll-mt-20 > a').content.strip
latest_version.rpartition(' ')[-1]
end
end
Expand Down
3 changes: 1 addition & 2 deletions lib/docs/scrapers/meteor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ class Meteor < UrlScraper
end

def get_latest_version(opts)
doc = fetch_doc('https://docs.meteor.com/#/full/', opts)
doc.at_css('select.version-select > option').content
get_npm_version('meteor', opts)
end
end
end
4 changes: 1 addition & 3 deletions lib/docs/scrapers/nix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ class Nix < UrlScraper

def get_latest_version(opts)
doc = fetch_doc('https://nixos.org/manual/nix/stable/', opts)
json = JSON.parse(doc.at_css('body')['data-nix-channels'])
channel = json.find { |c| c['channel'] == 'stable' }
channel['version']
doc.at_css('a.active')['href'].scan(/([0-9.]+)/)[0][0]
end
end
end
4 changes: 2 additions & 2 deletions lib/docs/scrapers/phpunit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class Phpunit < UrlScraper

def get_latest_version(opts)
doc = fetch_doc('https://phpunit.readthedocs.io/', opts)
label = doc.at_css('.rst-current-version').content.strip
label.scan(/v: ([0-9.]+)/)[0][0]
label = doc.at_css('meta[name="readthedocs-version-slug"]')["content"]
label
end

end
Expand Down
3 changes: 1 addition & 2 deletions lib/docs/scrapers/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class Redis < UrlScraper

def get_latest_version(opts)
body = fetch('http://download.redis.io/redis-stable/00-RELEASENOTES', opts)
body = body.lines[1..-1].join
body.scan(/Redis ([0-9.]+)/)[0][0]
body.scan(/Redis Community Edition ([0-9.]+)/)[0][0]
end

private
Expand Down
4 changes: 2 additions & 2 deletions lib/docs/scrapers/sass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class Sass < UrlScraper
&copy; 2006&ndash;2024 the Sass team, and numerous contributors<br>
Licensed under the MIT License.
HTML

private

def get_latest_version(opts)
get_npm_version('sass', opts)
end

private

def parse(response)
response.body.gsub! '<span class="widont">&nbsp;</span>', '&nbsp;'
end
Expand Down
2 changes: 1 addition & 1 deletion lib/docs/scrapers/trio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Trio < UrlScraper

def get_latest_version(opts)
doc = fetch_doc('https://trio.readthedocs.io/en/stable/', opts)
doc.at_css('.rst-other-versions a[href^="/en/v"]').content[1..-1]
doc.at_css('div.trio-version').content[0..-1]
end
end
end
Loading