Update Sinon version 7 and add version 8 and 9
Unified · Split
| @@ -20,7 +20,13 @@ module Docs · 19 unmodified lines | ||
| 20 | 20 | node['data-language'] = 'javascript' |
| 21 | 21 | end |
| 22 | 22 | |
| 23 | + css('#banner-message').remove | |
| 24 | + | |
| 25 | + # Removes duplicate title | |
| 26 | + css('#json-p').remove | |
| 27 | + | |
| 23 | 28 | doc |
| 29 | + | |
| 24 | 30 | end |
| 25 | 31 | end |
| 26 | 32 | end |
| @@ -14,12 +14,31 @@ module Docs · 13 unmodified lines | ||
| 14 | 14 | options[:container] = '.content .container' |
| 15 | 15 | |
| 16 | 16 | options[:attribution] = <<-HTML |
| 17 | − © 2010–2018 Christian Johansen<br> | |
| 17 | + © 2010–2020 Christian Johansen<br> | |
| 18 | 18 | Licensed under the BSD License. |
| 19 | 19 | HTML |
| 20 | 20 | |
| 21 | + # Links in page point to '../page' what makes devdocs points to non-existent links | |
| 22 | + options[:fix_urls] = -> (url) do | |
| 23 | + if !(url =~ /releases\/v\d*/) | |
| 24 | + url.gsub!(/.*releases\//, "") | |
| 25 | + end | |
| 26 | + | |
| 27 | + url | |
| 28 | + end | |
| 29 | + | |
| 30 | + version '9' do | |
| 31 | + self.release = '9.2.2' | |
| 32 | + self.base_url = "https://sinonjs.org/releases/v#{release}/" | |
| 33 | + end | |
| 34 | + | |
| 35 | + version '8' do | |
| 36 | + self.release = '8.1.1' | |
| 37 | + self.base_url = "https://sinonjs.org/releases/v#{release}/" | |
| 38 | + end | |
| 39 | + | |
| 21 | 40 | version '7' do |
| 22 | − self.release = '7.1.1' | |
| 41 | + self.release = '7.5.0' | |
| 23 | 42 | self.base_url = "https://sinonjs.org/releases/v#{release}/" |
| 24 | 43 | end |
| 25 | 44 | |
| @@ -54,8 +73,9 @@ module Docs · 28 unmodified lines | ||
| 54 | 73 | end |
| 55 | 74 | |
| 56 | 75 | def get_latest_version(opts) |
| 57 | − body = fetch('https://sinonjs.org/', opts) | |
| 58 | − body.scan(/\/releases\/v([0-9.]+)/)[0][0] | |
| 76 | + tags = get_github_tags('sinonjs', 'sinon', opts) | |
| 77 | + tags[0]['name'][1..-1] | |
| 59 | 78 | end |
| 79 | + | |
| 60 | 80 | end |
| 61 | 81 | end |