1
0

git.rb 746 B

12345678910111213141516171819202122232425262728
  1. module Docs
  2. class Git < UrlScraper
  3. self.type = 'git'
  4. self.release = '2.37.0'
  5. self.base_url = 'https://git-scm.com/docs'
  6. self.initial_paths = %w(/git.html)
  7. self.links = {
  8. home: 'https://git-scm.com/',
  9. code: 'https://github.com/git/git'
  10. }
  11. html_filters.push 'git/entries', 'git/clean_html'
  12. options[:container] = '#content'
  13. options[:only_patterns] = [/\A\/[^\/]+\z/]
  14. options[:skip] = %w(/howto-index.html)
  15. options[:attribution] = <<-HTML
  16. &copy; 2012&ndash;2022 Scott Chacon and others<br>
  17. Licensed under the MIT License.
  18. HTML
  19. def get_latest_version(opts)
  20. doc = fetch_doc('https://git-scm.com/', opts)
  21. doc.at_css('.version').content.strip
  22. end
  23. end
  24. end