haproxy.rb 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. module Docs
  2. class Haproxy < UrlScraper
  3. self.name = 'HAProxy'
  4. self.type = 'haproxy'
  5. self.root_path = 'intro.html'
  6. self.initial_paths = %w(intro.html configuration.html management.html)
  7. self.links = {
  8. home: 'https://www.haproxy.org/',
  9. code: 'https://github.com/haproxy/haproxy'
  10. }
  11. html_filters.push 'haproxy/clean_html', 'haproxy/entries'
  12. options[:container] = '#page-wrapper > .row > .col-lg-12'
  13. options[:follow_links] = false
  14. options[:attribution] = <<-HTML
  15. &copy; 2023 Willy Tarreau, HAProxy contributors<br>
  16. Licensed under the GNU General Public License version 2.
  17. HTML
  18. version '2.8' do
  19. self.release = '2.8.0'
  20. self.base_url = "https://docs.haproxy.org/#{self.version}/"
  21. end
  22. version '2.7' do
  23. self.release = '2.7.0'
  24. self.base_url = "https://docs.haproxy.org/#{self.version}/"
  25. end
  26. version '2.6' do
  27. self.release = '2.6.5'
  28. self.base_url = "https://docs.haproxy.org/#{self.version}/"
  29. end
  30. version '2.5' do
  31. self.release = '2.5.8'
  32. self.base_url = "https://docs.haproxy.org/#{self.version}/"
  33. end
  34. version '2.4' do
  35. self.release = '2.4.18'
  36. self.base_url = "https://docs.haproxy.org/#{self.version}/"
  37. end
  38. version '2.3' do
  39. self.release = '2.3.0'
  40. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  41. end
  42. version '2.2' do
  43. self.release = '2.2.5'
  44. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  45. end
  46. version '2.1' do
  47. self.release = '2.1.10'
  48. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  49. end
  50. version '2.0' do
  51. self.release = '2.0.19'
  52. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  53. end
  54. version '1.9' do
  55. self.release = '1.9.16'
  56. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  57. end
  58. version '1.8' do
  59. self.release = '1.8.27'
  60. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  61. end
  62. version '1.7' do
  63. self.release = '1.7.12'
  64. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  65. end
  66. def get_latest_version(opts)
  67. doc = fetch_doc('https://www.haproxy.org', opts)
  68. doc.at_css('table[cols=6]').at_css('tr:not(:first-child) > td:first-child:not(:contains("dev"))').content
  69. end
  70. end
  71. end