vue.rb 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. module Docs
  2. class Vue < UrlScraper
  3. self.name = 'Vue'
  4. self.slug = 'vue'
  5. self.type = 'vue'
  6. self.links = {
  7. home: 'https://vuejs.org/',
  8. code: 'https://github.com/vuejs/core'
  9. }
  10. options[:only_patterns] = [/^$/ ,/guide\//, /api\//]
  11. options[:skip] = %w(guide/team.html)
  12. options[:skip_patterns] = [/guide\/contributing/]
  13. options[:replace_paths] = { 'guide/' => 'guide/index.html' }
  14. options[:attribution] = <<-HTML
  15. &copy; 2013&ndash;present Yuxi Evan You<br>
  16. Licensed under the MIT License.
  17. HTML
  18. version '3' do
  19. self.release = '3.3.4'
  20. self.base_url = 'https://vuejs.org/'
  21. self.initial_paths = %w(guide/introduction.html)
  22. html_filters.push 'vue/entries_v3', 'vue/clean_html'
  23. end
  24. version '2' do
  25. self.release = '2.7.14'
  26. self.base_url = 'https://v2.vuejs.org/v2/'
  27. self.initial_paths = %w(api/)
  28. self.root_path = 'guide/'
  29. html_filters.push 'vue/entries', 'vue/clean_html'
  30. end
  31. version '1' do
  32. self.release = '1.0.28'
  33. self.base_url = 'https://v1.vuejs.org'
  34. self.initial_paths = %w(/api/index.html)
  35. html_filters.push 'vue/entries', 'vue/clean_html'
  36. end
  37. def get_latest_version(opts)
  38. get_npm_version('vue', opts)
  39. end
  40. end
  41. end