apache.rb 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. module Docs
  2. class Apache < UrlScraper
  3. self.name = 'Apache HTTP Server'
  4. self.slug = 'apache_http_server'
  5. self.type = 'apache'
  6. self.release = '2.4.37'
  7. self.base_url = 'https://httpd.apache.org/docs/2.4/en/'
  8. self.links = {
  9. home: 'https://httpd.apache.org/'
  10. }
  11. html_filters.push 'apache/clean_html', 'apache/entries'
  12. options[:container] = '#page-content'
  13. options[:skip] = %w(
  14. upgrading.html
  15. license.html
  16. sitemap.html
  17. glossary.html
  18. mod/quickreference.html
  19. mod/directive-dict.html
  20. mod/directives.html
  21. mod/module-dict.html
  22. programs/other.html)
  23. options[:skip_patterns] = [
  24. /\A(da|de|en|es|fr|ja|ko|pt-br|tr|zh-cn)\//,
  25. /\Anew_features/,
  26. /\Adeveloper\// ]
  27. options[:attribution] = <<-HTML
  28. &copy; 2018 The Apache Software Foundation<br>
  29. Licensed under the Apache License, Version 2.0.
  30. HTML
  31. def get_latest_version(opts)
  32. doc = fetch_doc('http://httpd.apache.org/docs/', opts)
  33. doc.at_css('#apcontents > ul a')['href'][0...-1]
  34. end
  35. end
  36. end