1
0

yarn.rb 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. module Docs
  2. class Yarn < UrlScraper
  3. self.type = 'simple'
  4. options[:root_title] = 'Yarn'
  5. options[:trailing_slash] = false
  6. options[:skip] = %w(nightly)
  7. options[:attribution] = <<-HTML
  8. &copy; 2016&ndash;present Yarn Contributors<br>
  9. Licensed under the BSD License.
  10. HTML
  11. version 'Berry' do
  12. self.release = '3.1.1'
  13. self.base_url = 'https://yarnpkg.com/'
  14. self.links = {
  15. home: 'https://yarnpkg.com/',
  16. code: 'https://github.com/yarnpkg/berry'
  17. }
  18. html_filters.push 'yarn/entries_berry', 'yarn/clean_html_berry', 'title'
  19. options[:skip] = ['features', 'cli', 'configuration', 'advanced']
  20. options[:skip_patterns] = [/\Aapi/, /\Apackage/]
  21. end
  22. version 'Classic' do
  23. self.release = '1.22.17'
  24. self.base_url = 'https://classic.yarnpkg.com/en/docs/'
  25. self.links = {
  26. home: 'https://classic.yarnpkg.com/',
  27. code: 'https://github.com/yarnpkg/yarn'
  28. }
  29. html_filters.push 'yarn/entries', 'yarn/clean_html', 'title'
  30. options[:skip_patterns] = [/\Aorg\//]
  31. end
  32. def get_latest_version(opts)
  33. get_latest_github_release('yarnpkg', 'berry', opts)[/[\d.]+/]
  34. end
  35. end
  36. end