codeceptjs.rb 1019 B

12345678910111213141516171819202122232425262728293031323334353637
  1. module Docs
  2. class Codeceptjs < UrlScraper
  3. self.name = 'CodeceptJS'
  4. self.type = 'simple'
  5. self.root_path = 'index.html'
  6. self.release = '3.0.2'
  7. self.base_url = 'https://codecept.io/'
  8. self.links = {
  9. home: 'https://codecept.io/',
  10. code: 'https://github.com/codeception/codeceptjs'
  11. }
  12. html_filters.push 'codeceptjs/clean_html', 'codeceptjs/entries', 'title'
  13. options[:root_title] = 'CodeceptJS'
  14. options[:title] = false
  15. options[:skip_links] = ->(filter) { !filter.root_page? }
  16. options[:skip_patterns] = [/changelog/, /quickstart\z/]
  17. options[:fix_urls] = -> (url) do
  18. url.sub! %r{\.html\z}, ''
  19. url.sub! %r{custom-helpers\z}, 'helpers'
  20. url
  21. end
  22. options[:trailing_slash] = true
  23. options[:attribution] = <<-HTML
  24. &copy; 2015 DavertMik &lt;davert@codegyre.com&gt; (http://codegyre.com)<br>
  25. Licensed under the MIT License.
  26. HTML
  27. def get_latest_version(opts)
  28. get_npm_version('codeceptjs', opts)
  29. end
  30. end
  31. end