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 node.js, homebrew, react-bootstrap #1992

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/docs/filters/react_bootstrap/clean_html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ def call
@doc = doc.at_css('main')

css('.flex-column.d-flex').remove
css('header').remove
css('.bs-example').remove
css('nav').remove
css('.clean-btn').remove
css('.tableOfContents_bqdL').remove

css('.position-relative pre').each do |node|
node.content = node.children.map(&:content).join("\n")
Expand All @@ -30,4 +32,4 @@ def call
end
end
end
end
end
21 changes: 13 additions & 8 deletions lib/docs/filters/react_bootstrap/entries.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
module Docs
class ReactBootstrap
class EntriesFilter < Docs::EntriesFilter
def get_name
name = at_css('#rb-docs-content h1, #rb-docs-content h2').content
if name.end_with? '#'
name = name[0..-2]
end
name
end
def get_name
header = at_css('header')
if header
name = header.at_css('h1').content
else
name = at_css('h1').content
end
if name.end_with?('#')
name = name[0..-2]
end
name.strip
end

def get_type
type = slug.split('/')[0..-2].join(': ')
Expand All @@ -20,4 +25,4 @@ def get_type
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/docs/scrapers/homebrew.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Docs
class Homebrew < UrlScraper
self.name = 'Homebrew'
self.type = 'simple'
self.release = '3.5.10'
self.release = '4.0.15'
self.base_url = 'https://docs.brew.sh/'
self.links = {
home: 'https://brew.sh',
Expand Down
4 changes: 2 additions & 2 deletions lib/docs/scrapers/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class Node < UrlScraper
Node.js is a trademark of Joyent, Inc. and is used with its permission.<br>
We are not endorsed by or affiliated with Joyent.
HTML

version do
self.release = '19.0.1'
self.release = '20.2.0'
self.base_url = 'https://nodejs.org/api/'
end

Expand Down
9 changes: 2 additions & 7 deletions lib/docs/scrapers/react_bootstrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class ReactBootstrap < UrlScraper
self.name = 'React Bootstrap'
self.slug = 'react_bootstrap'
self.type = 'simple'
self.release = '1.5.0'
self.release = '2.8.0'
self.base_url = 'https://react-bootstrap.github.io/'

self.links = {
Expand All @@ -23,13 +23,8 @@ class ReactBootstrap < UrlScraper
options[:trailing_slash] = true

options[:attribution] = <<-HTML
&copy; 2014&ndash;present Stephen J. Collings, Matthew Honnibal, Pieter Vanderwerff<br>
&copy; 2023 React Bootstrap.<br>
Licensed under the MIT License (MIT).
HTML

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]
end
end
end