1
0

electron.rb 914 B

123456789101112131415161718192021222324252627282930313233
  1. module Docs
  2. class Electron < UrlScraper
  3. self.type = 'simple'
  4. self.base_url = 'https://www.electronjs.org/docs/latest'
  5. self.release = '20.0.0'
  6. self.links = {
  7. home: 'https://www.electronjs.org/',
  8. code: 'https://github.com/electron/electron'
  9. }
  10. html_filters.push 'electron/clean_html', 'electron/entries'
  11. options[:trailing_slash] = false
  12. options[:container] = 'main'
  13. options[:skip] = %w(guides development tutorial versions all)
  14. options[:skip_patterns] = [
  15. /\/history\z/,
  16. ]
  17. options[:replace_paths] = {
  18. 'api/web-view-tag' => 'api/webview-tag'
  19. }
  20. options[:attribution] = <<-HTML
  21. &copy; GitHub Inc.<br>
  22. Licensed under the MIT license.
  23. HTML
  24. def get_latest_version(opts)
  25. doc = fetch_doc('https://www.electronjs.org/releases/stable', opts)
  26. doc.at_css(".tag").content.gsub!(/[a-zA-Z]/, '')
  27. end
  28. end
  29. end