zsh.rb 961 B

123456789101112131415161718192021222324252627282930313233
  1. module Docs
  2. class Zsh < UrlScraper
  3. self.type = 'zsh'
  4. self.release = '5.9.0'
  5. self.base_url = 'https://zsh.sourceforge.io/Doc/Release/'
  6. self.root_path = 'index.html'
  7. self.links = {
  8. home: 'https://zsh.sourceforge.io/',
  9. code: 'https://sourceforge.net/p/zsh/web/ci/master/tree/',
  10. }
  11. options[:skip] = %w(
  12. zsh_toc.html
  13. zsh_abt.html
  14. The-Z-Shell-Manual.html
  15. Introduction.html
  16. )
  17. options[:skip_patterns] = [/-Index.html/]
  18. html_filters.push 'zsh/entries', 'zsh/clean_html'
  19. options[:attribution] = <<-HTML
  20. The Z Shell is copyright &copy; 1992&ndash;2017 Paul Falstad, Richard Coleman,
  21. Zoltán Hidvégi, Andrew Main, Peter Stephenson, Sven Wischnowsky, and others.<br />
  22. Licensed under the MIT License.
  23. HTML
  24. def get_latest_version(opts)
  25. body = fetch('https://zsh.sourceforge.io/Doc/Release', opts)
  26. body.scan(/Zsh version ([0-9.]+)/)[0][0]
  27. end
  28. end
  29. end