Merge pull request #1438 from MasterEnoc/sinon

Update Sinon version 7 and add version 8 and 9
pull/1445/head
Simon Legner 4 years ago committed by GitHub
commit df9ff44afd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,7 +20,13 @@ module Docs
node['data-language'] = 'javascript' node['data-language'] = 'javascript'
end end
css('#banner-message').remove
# Removes duplicate title
css('#json-p').remove
doc doc
end end
end end
end end

@ -14,12 +14,31 @@ module Docs
options[:container] = '.content .container' options[:container] = '.content .container'
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2010&ndash;2018 Christian Johansen<br> &copy; 2010&ndash;2020 Christian Johansen<br>
Licensed under the BSD License. Licensed under the BSD License.
HTML HTML
# Links in page point to '../page' what makes devdocs points to non-existent links
options[:fix_urls] = -> (url) do
if !(url =~ /releases\/v\d*/)
url.gsub!(/.*releases\//, "")
end
url
end
version '9' do
self.release = '9.2.2'
self.base_url = "https://sinonjs.org/releases/v#{release}/"
end
version '8' do
self.release = '8.1.1'
self.base_url = "https://sinonjs.org/releases/v#{release}/"
end
version '7' do version '7' do
self.release = '7.1.1' self.release = '7.5.0'
self.base_url = "https://sinonjs.org/releases/v#{release}/" self.base_url = "https://sinonjs.org/releases/v#{release}/"
end end
@ -54,8 +73,9 @@ module Docs
end end
def get_latest_version(opts) def get_latest_version(opts)
body = fetch('https://sinonjs.org/', opts) tags = get_github_tags('sinonjs', 'sinon', opts)
body.scan(/\/releases\/v([0-9.]+)/)[0][0] tags[0]['name'][1..-1]
end end
end end
end end

Loading…
Cancel
Save