yarn.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_patterns] = [/\Aapi/, /\Apackage/]
  20. end
  21. version 'Classic' do
  22. self.release = '1.22.17'
  23. self.base_url = 'https://classic.yarnpkg.com/en/docs/'
  24. self.links = {
  25. home: 'https://classic.yarnpkg.com/',
  26. code: 'https://github.com/yarnpkg/yarn'
  27. }
  28. html_filters.push 'yarn/entries', 'yarn/clean_html', 'title'
  29. options[:skip_patterns] = [/\Aorg\//]
  30. end
  31. def get_latest_version(opts)
  32. get_latest_github_release('yarnpkg', 'berry', opts)
  33. end
  34. end
  35. end