ansible.rb 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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;2021 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 do
  31. self.base_url = "https://docs.ansible.com/ansible/latest/"
  32. end
  33. version '2.11' do
  34. self.release = '2.11.0'
  35. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  36. end
  37. version '2.10' do
  38. self.release = '2.10.5'
  39. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  40. end
  41. version '2.9' do
  42. self.release = '2.9.15'
  43. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  44. end
  45. version '2.8' do
  46. self.release = '2.8.16'
  47. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  48. end
  49. version '2.7' do
  50. self.release = '2.7.17'
  51. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  52. end
  53. version '2.6' do
  54. self.release = '2.6.20'
  55. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  56. end
  57. version '2.5' do
  58. self.release = '2.5.15'
  59. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  60. end
  61. version '2.4' do
  62. self.release = '2.4.6'
  63. self.base_url = "https://docs.ansible.com/ansible/#{version}/"
  64. options[:skip] = %w(
  65. glossary.html
  66. faq.html
  67. community.html
  68. tower.html
  69. quickstart.html
  70. list_of_all_modules.html)
  71. options[:skip_patterns] = []
  72. end
  73. def get_latest_version(opts)
  74. tags = get_github_tags('ansible', 'ansible', opts)
  75. tags[0]['name'][1..-1]
  76. end
  77. end
  78. end