1
0

octave.rb 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. module Docs
  2. class Octave < UrlScraper
  3. self.name = 'Octave'
  4. self.type = 'octave'
  5. self.release = '5.1.0'
  6. self.base_url = 'https://octave.org/doc/interpreter/'
  7. self.root_path = 'index.html'
  8. self.links = {
  9. home: 'http://www.octave.org/',
  10. code: 'http://www.octave.org/hg/octave'
  11. }
  12. html_filters.push 'octave/clean_html', 'octave/entries', 'title'
  13. options[:skip] = %w(
  14. Copying.html
  15. Preface.html
  16. Acknowledgements.html
  17. Citing-Octave-in-Publications.html
  18. How-You-Can-Contribute-to-Octave.html
  19. Distribution.html)
  20. options[:title] = false
  21. options[:root_title] = 'GNU Octave'
  22. options[:attribution] = <<-HTML
  23. &copy; 1996&ndash;2018 John W. Eaton<br>
  24. 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/>
  25. 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>
  26. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
  27. HTML
  28. def get_latest_version(opts)
  29. doc = fetch_doc('https://octave.org/doc/interpreter/', opts)
  30. doc.at_css('h1').content.scan(/([0-9.]+)/)[0][0]
  31. end
  32. end
  33. end