falcon.rb 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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)
  12. options[:skip_patterns] = [/\Achanges/, /\A_modules/, /\Acommunity/]
  13. options[:attribution] = <<-HTML
  14. &copy; 2012&ndash;2017 by Rackspace Hosting, Inc. and other contributors<br>
  15. Licensed under the Apache License, Version 2.0.
  16. HTML
  17. version '1.4' do
  18. self.release = '1.4.1'
  19. self.base_url = "https://falcon.readthedocs.io/en/#{self.release}/"
  20. end
  21. version '1.3' do
  22. self.release = '1.3.0'
  23. self.base_url = "https://falcon.readthedocs.io/en/#{self.release}/"
  24. end
  25. version '1.2' do
  26. self.release = '1.2.0'
  27. self.base_url = "https://falcon.readthedocs.io/en/#{self.release}/"
  28. end
  29. def get_latest_version(opts)
  30. doc = fetch_doc('https://falcon.readthedocs.io/en/stable/changes/index.html', opts)
  31. doc.at_css('#changelogs ul > li > a').content
  32. end
  33. end
  34. end