1
0

ansible.rb 2.3 KB

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