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