ansible.rb 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. module Docs
  2. class Ansible < UrlScraper
  3. self.name = 'Ansible'
  4. self.type = 'sphinx'
  5. self.links = {
  6. home: 'https://www.ansible.com/',
  7. code: 'https://github.com/ansible/ansible'
  8. }
  9. html_filters.push 'ansible/entries', 'sphinx/clean_html', 'ansible/clean_html'
  10. options[:attribution] = <<-HTML
  11. &copy; 2012&ndash;2018 Michael DeHaan<br>
  12. &copy; 2018&ndash;2019 Red Hat, Inc.<br>
  13. Licensed under the GNU General Public License version 3.
  14. HTML
  15. options[:skip] = %w(
  16. installation_guide/index.html
  17. reference_appendices/glossary.html
  18. reference_appendices/faq.html
  19. reference_appendices/tower.html
  20. user_guide/quickstart.html
  21. modules/modules_by_category.html
  22. modules/list_of_all_modules.html
  23. collections/all_plugins.html
  24. collections/index_vars.html)
  25. options[:skip_patterns] = [
  26. /\Acommunity.*/i,
  27. /\Adev_guide.*/i,
  28. /\Aroadmap.*/i,
  29. ]
  30. version '2.10' do
  31. self.release = '2.10.5'
  32. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  33. end
  34. version '2.9' do
  35. self.release = '2.9.15'
  36. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  37. end
  38. version '2.8' do
  39. self.release = '2.8.16'
  40. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  41. end
  42. version '2.7' do
  43. self.release = '2.7.17'
  44. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  45. end
  46. version '2.6' do
  47. self.release = '2.6.20'
  48. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  49. end
  50. version '2.5' do
  51. self.release = '2.5.15'
  52. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  53. end
  54. version '2.4' do
  55. self.release = '2.4.6'
  56. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  57. options[:skip] = %w(
  58. glossary.html
  59. faq.html
  60. community.html
  61. tower.html
  62. quickstart.html
  63. list_of_all_modules.html)
  64. options[:skip_patterns] = []
  65. end
  66. def get_latest_version(opts)
  67. tags = get_github_tags('ansible', 'ansible', opts)
  68. tags[0]['name'][1..-1]
  69. end
  70. end
  71. end