1
0

mariadb.rb 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. module Docs
  2. class Mariadb < UrlScraper
  3. self.name = 'MariaDB'
  4. self.type = 'mariadb'
  5. self.release = '10.4.8'
  6. self.base_url = 'https://mariadb.com/kb/en/'
  7. self.root_path = 'library/documentation/'
  8. self.links = {
  9. home: 'https://mariadb.com/',
  10. code: 'https://github.com/MariaDB/server'
  11. }
  12. html_filters.insert_before 'internal_urls', 'mariadb/erase_invalid_pages'
  13. html_filters.push 'mariadb/entries', 'mariadb/clean_html'
  14. options[:rate_limit] = 200
  15. options[:skip_patterns] = [
  16. /\+/,
  17. /\/ask\//,
  18. /-release-notes\//,
  19. /-changelog\//,
  20. /^documentation\//,
  21. /^mariadb-server-documentation\//,
  22. ]
  23. options[:attribution] = <<-HTML
  24. &copy; 2019 MariaDB<br>
  25. Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
  26. HTML
  27. def get_latest_version(opts)
  28. doc = fetch_doc('https://mariadb.com/downloads/', opts)
  29. doc.at_css('[data-version-id="mariadb_server-versions"] option').content.split('-')[0]
  30. end
  31. end
  32. end