vue.rb 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. module Docs
  2. class Vue < UrlScraper
  3. self.name = 'Vue.js'
  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.2.31'
  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.6.12'
  26. self.base_url = 'https://v2.vuejs.org/'
  27. self.root_path = 'guide/index.html'
  28. self.initial_paths = %w(api/)
  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.root_path = '/guide/index.html'
  35. self.initial_paths = %w(/api/index.html)
  36. html_filters.push 'vue/entries', 'vue/clean_html'
  37. end
  38. def get_latest_version(opts)
  39. get_npm_version('vue', opts)
  40. end
  41. end
  42. end