vue.rb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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[: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.26'
  20. self.base_url = 'https://v3.vuejs.org/'
  21. self.root_path = 'guide/introduction.html'
  22. self.initial_paths = %w(api/)
  23. html_filters.push 'vue/entries_v3', 'vue/clean_html'
  24. end
  25. version '2' do
  26. self.release = '2.6.12'
  27. self.base_url = 'https://vuejs.org/v2/'
  28. self.root_path = 'guide/index.html'
  29. self.initial_paths = %w(api/)
  30. html_filters.push 'vue/entries', 'vue/clean_html'
  31. end
  32. version '1' do
  33. self.release = '1.0.28'
  34. self.base_url = 'https://v1.vuejs.org'
  35. self.root_path = '/guide/index.html'
  36. self.initial_paths = %w(/api/index.html)
  37. html_filters.push 'vue/entries', 'vue/clean_html'
  38. end
  39. def get_latest_version(opts)
  40. get_npm_version('vue', opts, 'next')
  41. end
  42. end
  43. end