1
0

fish.rb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. module Docs
  2. class Fish < UrlScraper
  3. self.name = 'Fish'
  4. self.type = 'simple'
  5. self.root_path = 'index.html'
  6. self.links = {
  7. home: 'https://fishshell.com/',
  8. code: 'https://github.com/fish-shell/fish-shell'
  9. }
  10. html_filters.push 'fish/clean_html', 'fish/entries'
  11. options[:skip] = %w(design.html license.html)
  12. options[:attribution] = <<-HTML
  13. &copy; 2005&ndash;2009 Axel Liljencrantz<br>
  14. Licensed under the GNU General Public License, version 2.
  15. HTML
  16. version '2.7' do
  17. self.release = '2.7.1'
  18. self.base_url = "https://fishshell.com/docs/#{version}/"
  19. end
  20. version '2.6' do
  21. self.release = '2.6.0'
  22. self.base_url = "https://fishshell.com/docs/#{version}/"
  23. end
  24. version '2.5' do
  25. self.release = '2.5.0'
  26. self.base_url = "https://fishshell.com/docs/#{version}/"
  27. end
  28. version '2.4' do
  29. self.release = '2.4.0'
  30. self.base_url = "https://fishshell.com/docs/#{version}/"
  31. end
  32. version '2.3' do
  33. self.release = '2.3.1'
  34. self.base_url = "https://fishshell.com/docs/#{version}/"
  35. end
  36. version '2.2' do
  37. self.release = '2.2.0'
  38. self.base_url = "https://fishshell.com/docs/#{version}/"
  39. end
  40. def get_latest_version(opts)
  41. doc = fetch_doc('http://fishshell.com/docs/current/index.html', opts)
  42. doc.at_css('#toc-index').content.scan(/([0-9.]+)/)[0][0]
  43. end
  44. end
  45. end