gnu_cobol.rb 848 B

1234567891011121314151617181920212223242526
  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. doc = fetch_doc('https://open-cobol.sourceforge.io/HTML/gnucobpg.html', opts)
  19. title = doc.at_css('h1').content
  20. title.scan(/([0-9.]+)/)[0][0]
  21. end
  22. end
  23. end