meteor.rb 783 B

123456789101112131415161718192021222324252627282930313233
  1. module Docs
  2. class Meteor < UrlScraper
  3. include StubRootPage
  4. self.type = 'meteor'
  5. self.version = '1.1.0'
  6. self.base_url = 'http://docs.meteor.com'
  7. self.root_path = '/#/full/'
  8. self.links = {
  9. home: 'https://www.meteor.com/',
  10. code: 'https://github.com/meteor/meteor/'
  11. }
  12. html_filters.push 'meteor/entries', 'meteor/clean_html', 'title'
  13. options[:title] = 'Meteor'
  14. options[:skip_links] = true
  15. options[:attribution] = <<-HTML
  16. &copy; 2011&ndash;2015 Meteor Development Group<br>
  17. Licensed under the MIT License.
  18. HTML
  19. private
  20. def root_page_body
  21. require 'capybara'
  22. Capybara.current_driver = :selenium
  23. Capybara.visit(root_url.to_s)
  24. Capybara.find('.body')['innerHTML']
  25. end
  26. end
  27. end