bash.rb 766 B

123456789101112131415161718192021222324
  1. module Docs
  2. class Bash < UrlScraper
  3. self.type = 'bash'
  4. self.release = '5.1'
  5. self.base_url = 'https://www.gnu.org/software/bash/manual/html_node'
  6. self.root_path = 'index.html'
  7. self.links = {
  8. home: 'https://www.gnu.org/software/bash/',
  9. code: 'http://git.savannah.gnu.org/cgit/bash.git'
  10. }
  11. html_filters.push 'bash/entries', 'bash/clean_html'
  12. options[:attribution] = <<-HTML
  13. Copyright &copy; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br>
  14. Licensed under the GNU Free Documentation License.
  15. HTML
  16. def get_latest_version(opts)
  17. body = fetch('https://www.gnu.org/software/bash/manual/html_node/index.html', opts)
  18. body.scan(/, Version ([0-9.]+)/)[0][0][0...-1]
  19. end
  20. end
  21. end