bash.rb 816 B

1234567891011121314151617181920212223242526
  1. module Docs
  2. class Bash < UrlScraper
  3. self.type = 'bash'
  4. self.release = '4.4'
  5. self.base_url = 'https://www.gnu.org/software/bash/manual'
  6. self.root_path = '/html_node/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[:only_patterns] = [/\/html_node\//]
  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. body = fetch('https://www.gnu.org/software/bash/manual/html_node/index.html', opts)
  19. body.scan(/, Version ([0-9.]+)/)[0][0][0...-1]
  20. end
  21. end
  22. end