1
0

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/vue'
  9. }
  10. options[:only_patterns] = [/guide\//, /api\//]
  11. options[:skip] = %w(guide/team.html)
  12. options[:replace_paths] = { 'guide/' => 'guide/index.html' }
  13. options[:attribution] = <<-HTML
  14. &copy; 2013&ndash;present Yuxi Evan You<br>
  15. Licensed under the MIT License.
  16. HTML
  17. version '3' do
  18. self.release = '3.0.5'
  19. self.base_url = 'https://v3.vuejs.org/'
  20. self.root_path = 'guide/introduction.html'
  21. self.initial_paths = %w(api/)
  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://vuejs.org/v2/'
  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, 'next')
  40. end
  41. end
  42. end