Unified · Split
| @@ -203,7 +203,7 @@ credits = [ · 202 unmodified lines | |||
| 203 | 'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE' | 203 | 'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE' |
| 204 | ], [ | 204 | ], [ |
| 205 | 'CSS<br>DOM<br>HTTP<br>HTML<br>JavaScript<br>SVG<br>XPath', | 205 | 'CSS<br>DOM<br>HTTP<br>HTML<br>JavaScript<br>SVG<br>XPath', |
| 206 | '2005-2017 Mozilla Developer Network and individual contributors', | 206 | '2005-2020 Mozilla and individual contributors', |
| 207 | 'CC BY-SA', | 207 | 'CC BY-SA', |
| 208 | 'https://creativecommons.org/licenses/by-sa/2.5/' | 208 | 'https://creativecommons.org/licenses/by-sa/2.5/' |
| 209 | ], [ | 209 | ], [ |
| @@ -17,18 +17,20 @@ module Docs · 16 unmodified lines | |||
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | options[:attribution] = <<-HTML | 19 | options[:attribution] = <<-HTML |
| 20 | © 2005–2018 Mozilla Developer Network and individual contributors.<br> | 20 | © 2005–2020 Mozilla and individual contributors.<br> |
| 21 | Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later. | 21 | Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later. |
| 22 | HTML | 22 | HTML |
| 23 | 23 | ||
| 24 | def get_latest_version(opts) | 24 | def get_latest_version(opts) |
| 25 | json = fetch_json("https://developer.mozilla.org/en-US/docs/feeds/json/tag/#{options[:mdn_tag]}", opts) | 25 | json = fetch_json("https://developer.mozilla.org/en-US/docs/feeds/json/tag/#{options[:mdn_tag]}", opts) |
| 26 | DateTime.parse(json[0]['pubdate']).to_time.to_i | 26 | dates = json.map { |i| i['pubdate'] } |
| 27 | DateTime.parse(dates.max).to_time.to_i | ||
| 27 | end | 28 | end |
| 28 | 29 | ||
| 29 | private | 30 | private |
| 30 | 31 | ||
| 31 | def process_response?(response) | 32 | def process_response?(response) |
| 33 | response.effective_url.host = 'developer.mozilla.org' if response.effective_url.host == 'wiki.developer.mozilla.org' | ||
| 32 | super && response.effective_url.query == 'raw=1¯os=1' | 34 | super && response.effective_url.query == 'raw=1¯os=1' |
| 33 | end | 35 | end |
| 34 | end | 36 | end |
| @@ -15,10 +15,7 @@ module Docs · 14 unmodified lines | |||
| 15 | options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/] | 15 | options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/] |
| 16 | 16 | ||
| 17 | options[:fix_urls] = ->(url) do | 17 | options[:fix_urls] = ->(url) do |
| 18 | url.sub! 'https://developer.mozilla.org/en/XPath', "#{XsltXpath.base_url}/XPath" | 18 | url.sub! 'https://developer.mozilla.org/en-US/docs/Web/XSLT/Element', "#{XsltXpath.base_url}/XSLT" |
| 19 | url.sub! 'https://developer.mozilla.org/en/XSLT', "#{XsltXpath.base_url}/XSLT" | ||
| 20 | url.sub! 'https://developer.mozilla.org/en-US/docs/XPath', "#{XsltXpath.base_url}/XPath" | ||
| 21 | url.sub! 'https://developer.mozilla.org/en-US/docs/XSLT', "#{XsltXpath.base_url}/XSLT" | ||
| 22 | url | 19 | url |
| 23 | end | 20 | end |
| 24 | end | 21 | end |