vue.rb 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.2.45'
  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. html_filters.push 'vue/entries', 'vue/clean_html'
  29. end
  30. version '1' do
  31. self.release = '1.0.28'
  32. self.base_url = 'https://v1.vuejs.org'
  33. self.initial_paths = %w(/api/index.html)
  34. html_filters.push 'vue/entries', 'vue/clean_html'
  35. end
  36. def get_latest_version(opts)
  37. get_npm_version('vue', opts)
  38. end
  39. end
  40. end