You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/lib/docs/scrapers/git.rb

29 lines
746 B

module Docs
class Git < UrlScraper
self.type = 'git'
self.release = '2.33.1'
self.base_url = 'https://git-scm.com/docs'
self.initial_paths = %w(/git.html)
self.links = {
home: 'https://git-scm.com/',
code: 'https://github.com/git/git'
}
html_filters.push 'git/entries', 'git/clean_html'
options[:container] = '#content'
options[:only_patterns] = [/\A\/[^\/]+\z/]
options[:skip] = %w(/howto-index.html)
options[:attribution] = <<-HTML
&copy; 2012&ndash;2021 Scott Chacon and others<br>
Licensed under the MIT License.
HTML
def get_latest_version(opts)
doc = fetch_doc('https://git-scm.com/', opts)
doc.at_css('.version').content.strip
end
end
end