mariadb.rb 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. module Docs
  2. class Mariadb < UrlScraper
  3. self.name = 'MariaDB'
  4. self.type = 'mariadb'
  5. self.release = '10.4.7'
  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[:skip_patterns] = [
  15. /\+/,
  16. /\/ask\//,
  17. /-release-notes\//,
  18. /-changelog\//,
  19. /^documentation\//,
  20. /^mariadb-server-documentation\//,
  21. ]
  22. options[:attribution] = <<-HTML
  23. &copy; 2019 MariaDB<br>
  24. Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
  25. HTML
  26. def get_latest_version(opts)
  27. doc = fetch_doc('https://mariadb.com/downloads/', opts)
  28. doc.at_css('[data-version-id="mariadb_server-versions"] option').content.split('-')[0]
  29. end
  30. end
  31. end