1
0

gnu_cobol.rb 926 B

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