octave.rb 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. module Docs
  2. class Octave < UrlScraper
  3. self.name = 'Octave'
  4. self.type = 'octave'
  5. self.root_path = 'index.html'
  6. self.links = {
  7. home: 'http://www.octave.org/',
  8. code: 'http://www.octave.org/hg/octave'
  9. }
  10. html_filters.push 'octave/clean_html', 'octave/entries', 'title'
  11. options[:skip] = %w(
  12. Copying.html
  13. Preface.html
  14. Acknowledgements.html
  15. Citing-Octave-in-Publications.html
  16. How-You-Can-Contribute-to-Octave.html
  17. Distribution.html)
  18. options[:title] = false
  19. options[:root_title] = 'GNU Octave'
  20. options[:attribution] = <<-HTML
  21. &copy; 1996–2022 The Octave Project Developers<br>
  22. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.<br/>
  23. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.</br>
  24. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
  25. HTML
  26. version '7' do
  27. self.release = '7.1.0'
  28. self.base_url = "https://octave.org/doc/v#{self.release}/"
  29. end
  30. version '6' do
  31. self.release = '6.4.0'
  32. self.base_url = "https://octave.org/doc/v#{self.release}/"
  33. end
  34. version '5' do
  35. self.release = '5.2.0'
  36. self.base_url = "https://octave.org/doc/v#{self.release}/"
  37. end
  38. def get_latest_version(opts)
  39. doc = fetch_doc('https://octave.org/doc/interpreter/', opts)
  40. doc.at_css('h1').content.scan(/([0-9.]+)/)[0][0]
  41. end
  42. end
  43. end