haproxy.rb 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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; 2022 Willy Tarreau, HAProxy contributors<br>
  16. Licensed under the GNU General Public License version 2.
  17. HTML
  18. version '2.7' do
  19. self.release = '2.7.0'
  20. self.base_url = "https://docs.haproxy.org/#{self.version}/"
  21. end
  22. version '2.6' do
  23. self.release = '2.6.5'
  24. self.base_url = "https://docs.haproxy.org/#{self.version}/"
  25. end
  26. version '2.5' do
  27. self.release = '2.5.8'
  28. self.base_url = "https://docs.haproxy.org/#{self.version}/"
  29. end
  30. version '2.4' do
  31. self.release = '2.4.18'
  32. self.base_url = "https://docs.haproxy.org/#{self.version}/"
  33. end
  34. version '2.3' do
  35. self.release = '2.3.0'
  36. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  37. end
  38. version '2.2' do
  39. self.release = '2.2.5'
  40. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  41. end
  42. version '2.1' do
  43. self.release = '2.1.10'
  44. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  45. end
  46. version '2.0' do
  47. self.release = '2.0.19'
  48. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  49. end
  50. version '1.9' do
  51. self.release = '1.9.16'
  52. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  53. end
  54. version '1.8' do
  55. self.release = '1.8.27'
  56. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  57. end
  58. version '1.7' do
  59. self.release = '1.7.12'
  60. self.base_url = "http://cbonte.github.io/haproxy-dconv/#{self.version}/"
  61. end
  62. def get_latest_version(opts)
  63. doc = fetch_doc('https://www.haproxy.org', opts)
  64. doc.at_css('table[cols=6]').at_css('tr:not(:first-child) > td:first-child:not(:contains("dev"))').content
  65. end
  66. end
  67. end