babel.rb 775 B

12345678910111213141516171819202122232425262728293031
  1. module Docs
  2. class Babel < UrlScraper
  3. self.type = 'simple'
  4. self.base_url = 'http://babeljs.io/docs/'
  5. self.release = '6.26.1'
  6. self.initial_paths = %w(core-packages/)
  7. self.links = {
  8. home: 'https://babeljs.io/',
  9. code: 'https://github.com/babel/babel'
  10. }
  11. html_filters.push 'babel/clean_html', 'babel/entries'
  12. options[:trailing_slash] = true
  13. options[:skip] = %w{setup/ editors/ community/videos/}
  14. options[:attribution] = <<-HTML
  15. &copy; 2018 Sebastian McKenzie<br>
  16. Licensed under the MIT License.
  17. HTML
  18. stub '' do
  19. '<div></div>'
  20. end
  21. def get_latest_version(opts)
  22. doc = fetch_doc('https://babeljs.io/docs/en/', opts)
  23. doc.at_css('a[href="/versions"] > h3').content
  24. end
  25. end
  26. end