mongoose.rb 914 B

123456789101112131415161718192021222324252627282930313233343536
  1. module Docs
  2. class Mongoose < UrlScraper
  3. self.name = 'Mongoose'
  4. self.type = 'simple'
  5. self.release = '4.13.1'
  6. self.base_url = 'http://mongoosejs.com/docs/'
  7. self.root_path = 'index.html'
  8. self.initial_paths = %w(guide.html api.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. faq.html
  18. prior.html
  19. migration.html
  20. plugins)
  21. options[:attribution] = <<-HTML
  22. &copy; 2010 LearnBoost<br>
  23. Licensed under the MIT License.
  24. HTML
  25. def get_latest_version(opts)
  26. doc = fetch_doc('https://mongoosejs.com/docs/', opts)
  27. label = doc.at_css('.pure-menu-link').content.strip
  28. label.sub(/Version /, '')
  29. end
  30. end
  31. end