meteor.rb 955 B

123456789101112131415161718192021222324252627282930313233343536
  1. module Docs
  2. class Meteor < UrlScraper
  3. self.type = 'meteor'
  4. self.release = '1.3.0'
  5. self.base_url = 'http://guide.meteor.com/v1.3/'
  6. self.initial_paths = %w(guide)
  7. self.links = {
  8. home: 'https://www.meteor.com/',
  9. code: 'https://github.com/meteor/meteor/'
  10. }
  11. html_filters.push 'meteor/entries', 'meteor/clean_html'
  12. options[:skip_links] = ->(filter) { filter.root_page? }
  13. options[:attribution] = <<-HTML
  14. &copy; 2011&ndash;2016 Meteor Development Group<br>
  15. Licensed under the MIT License.
  16. HTML
  17. stub '' do
  18. require 'capybara/dsl'
  19. Capybara.current_driver = :selenium
  20. Capybara.run_server = false
  21. Capybara.app_host = 'https://docs.meteor.com'
  22. Capybara.visit('/#/full/')
  23. Capybara.find('.body')['innerHTML']
  24. end
  25. stub 'guide' do
  26. request_one(url_for('index.html')).body
  27. end
  28. options[:replace_paths] = { 'index.html' => 'guide' }
  29. end
  30. end