mongoose.rb 920 B

12345678910111213141516171819202122232425262728293031323334353637
  1. module Docs
  2. class Mongoose < UrlScraper
  3. self.name = 'Mongoose'
  4. self.type = 'simple'
  5. self.release = '5.8.5'
  6. self.base_url = 'https://mongoosejs.com/docs/'
  7. self.root_path = 'index.html'
  8. self.initial_paths = %w(guide.html)
  9. self.force_gzip = true
  10. self.links = {
  11. home: 'http://mongoosejs.com/',
  12. code: 'https://github.com/Automattic/mongoose'
  13. }
  14. html_filters.push 'mongoose/clean_html', 'mongoose/entries'
  15. options[:container] = '#content'
  16. options[:skip] = %w(
  17. api.html
  18. faq.html
  19. prior.html
  20. migration.html
  21. plugins)
  22. options[:attribution] = <<-HTML
  23. &copy; 2010 LearnBoost<br>
  24. Licensed under the MIT License.
  25. HTML
  26. def get_latest_version(opts)
  27. doc = fetch_doc('https://mongoosejs.com/docs/', opts)
  28. label = doc.at_css('.pure-menu-link').content.strip
  29. label.sub(/Version /, '')
  30. end
  31. end
  32. end