1
0

yarn.rb 793 B

123456789101112131415161718192021222324252627282930
  1. module Docs
  2. class Yarn < UrlScraper
  3. self.type = 'simple'
  4. self.release = '1.12.1'
  5. self.base_url = 'https://yarnpkg.com/en/docs/'
  6. self.links = {
  7. home: 'https://yarnpkg.com/',
  8. code: 'https://github.com/yarnpkg/yarn'
  9. }
  10. html_filters.push 'yarn/entries', 'yarn/clean_html', 'title'
  11. options[:root_title] = 'Yarn'
  12. options[:trailing_slash] = false
  13. options[:skip] = %w(nightly)
  14. options[:skip_patterns] = [/\Aorg\//]
  15. options[:attribution] = <<-HTML
  16. &copy; 2016&ndash;present Yarn Contributors<br>
  17. Licensed under the BSD License.
  18. HTML
  19. def get_latest_version(options, &block)
  20. get_latest_github_release('yarnpkg', 'yarn', options) do |release|
  21. block.call release['tag_name'][1..-1]
  22. end
  23. end
  24. end
  25. end