You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/lib/docs/scrapers/gnu_cobol.rb

29 lines
909 B

module Docs
class GnuCobol < UrlScraper
self.name = 'GnuCOBOL'
self.slug = 'gnu_cobol'
self.type = 'simple'
self.release = '2.2'
self.base_url = 'https://open-cobol.sourceforge.io/HTML/gnucobpg.html'
self.links = {
home: 'https://sourceforge.net/projects/open-cobol/',
code: 'https://sourceforge.net/p/open-cobol/code/HEAD/tree/trunk/'
}
html_filters.push 'gnu_cobol/entries', 'gnu_cobol/clean_html'
options[:attribution] = <<-HTML
Copyright &copy; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br>
Licensed under the GNU Free Documentation License.
HTML
def get_latest_version(opts)
fetch_doc('https://sourceforge.net/projects/gnucobol/files/gnucobol/', opts)
.css('#files_list > tbody > tr')
.map { |file| file['title'] }
.sort_by { |version| version.to_f }
.last
end
end
end