gnu_cobol.rb 909 B

12345678910111213141516171819202122232425262728
  1. module Docs
  2. class GnuCobol < UrlScraper
  3. self.name = 'GnuCOBOL'
  4. self.slug = 'gnu_cobol'
  5. self.type = 'simple'
  6. self.release = '2.2'
  7. self.base_url = 'https://open-cobol.sourceforge.io/HTML/gnucobpg.html'
  8. self.links = {
  9. home: 'https://sourceforge.net/projects/open-cobol/',
  10. code: 'https://sourceforge.net/p/open-cobol/code/HEAD/tree/trunk/'
  11. }
  12. html_filters.push 'gnu_cobol/entries', 'gnu_cobol/clean_html'
  13. options[:attribution] = <<-HTML
  14. Copyright &copy; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br>
  15. Licensed under the GNU Free Documentation License.
  16. HTML
  17. def get_latest_version(opts)
  18. fetch_doc('https://sourceforge.net/projects/gnucobol/files/gnucobol/', opts)
  19. .css('#files_list > tbody > tr')
  20. .map { |file| file['title'] }
  21. .sort_by { |version| version.to_f }
  22. .last
  23. end
  24. end
  25. end