cypress.rb 1000 B

123456789101112131415161718192021222324252627282930313233343536
  1. # frozen_string_literal: true
  2. module Docs
  3. class Cypress < UrlScraper
  4. self.name = 'Cypress'
  5. self.type = 'cypress'
  6. self.release = '3.4.1'
  7. self.base_url = 'https://docs.cypress.io'
  8. self.root_path = '/api/api/table-of-contents.html'
  9. self.links = {
  10. home: 'https://www.cypress.io/',
  11. code: 'https://github.com/cypress-io/cypress',
  12. }
  13. html_filters.push 'cypress/entries', 'cypress/clean_html'
  14. options[:container] = '#content'
  15. options[:max_image_size] = 300_000
  16. options[:include_default_entry] = true
  17. options[:skip_patterns] = [/examples\//]
  18. options[:skip_link] = ->(link) {
  19. href = link.attr(:href)
  20. href.nil? ? true : EntriesFilter::SECTIONS.none? { |section| href.match?("/#{section}/") }
  21. }
  22. options[:attribution] = <<-HTML
  23. &copy; 2017 Cypress.io<br>
  24. Licensed under the MIT License.
  25. HTML
  26. def get_latest_version(opts)
  27. get_latest_github_release('cypress-io', 'cypress', opts)
  28. end
  29. end
  30. end