falcon.rb 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. module Docs
  2. class Falcon < UrlScraper
  3. self.type = 'sphinx'
  4. self.root_path = 'index.html'
  5. self.links = {
  6. home: 'https://falconframework.org/',
  7. code: 'https://github.com/falconry/falcon'
  8. }
  9. html_filters.push 'falcon/entries', 'sphinx/clean_html'
  10. options[:container] = '.body'
  11. options[:skip] = %w(user/index.html api/index.html deploy/index.html)
  12. options[:skip_patterns] = [/\Achanges/, /\A_modules/, /\Acommunity/]
  13. options[:attribution] = <<-HTML
  14. &copy; 2019 by Falcon contributors<br>
  15. Licensed under the Apache License, Version 2.0.
  16. HTML
  17. version '2.0' do
  18. self.release = '2.0.0'
  19. self.base_url = "https://falcon.readthedocs.io/en/#{self.release}/"
  20. end
  21. version '1.4' do
  22. self.release = '1.4.1'
  23. self.base_url = "https://falcon.readthedocs.io/en/#{self.release}/"
  24. end
  25. version '1.3' do
  26. self.release = '1.3.0'
  27. self.base_url = "https://falcon.readthedocs.io/en/#{self.release}/"
  28. end
  29. version '1.2' do
  30. self.release = '1.2.0'
  31. self.base_url = "https://falcon.readthedocs.io/en/#{self.release}/"
  32. end
  33. def get_latest_version(opts)
  34. doc = fetch_doc('https://falcon.readthedocs.io/en/stable/changes/index.html', opts)
  35. doc.at_css('#changelogs ul > li > a').content
  36. end
  37. end
  38. end