Unified · Split
| @@ -203,7 +203,7 @@ credits = [ · 202 unmodified lines | ||
| 203 | 203 | 'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE' |
| 204 | 204 | ], [ |
| 205 | 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 | 207 | 'CC BY-SA', |
| 208 | 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 | 19 | options[:attribution] = <<-HTML |
| 20 | − © 2005–2018 Mozilla Developer Network and individual contributors.<br> | |
| 20 | + © 2005–2020 Mozilla and individual contributors.<br> | |
| 21 | 21 | Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later. |
| 22 | 22 | HTML |
| 23 | 23 | |
| 24 | 24 | def get_latest_version(opts) |
| 25 | 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 | 28 | end |
| 28 | 29 | |
| 29 | 30 | private |
| 30 | 31 | |
| 31 | 32 | def process_response?(response) |
| 33 | + response.effective_url.host = 'developer.mozilla.org' if response.effective_url.host == 'wiki.developer.mozilla.org' | |
| 32 | 34 | super && response.effective_url.query == 'raw=1¯os=1' |
| 33 | 35 | end |
| 34 | 36 | end |
| @@ -15,10 +15,7 @@ module Docs · 14 unmodified lines | ||
| 15 | 15 | options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/] |
| 16 | 16 | |
| 17 | 17 | options[:fix_urls] = ->(url) do |
| 18 | − url.sub! 'https://developer.mozilla.org/en/XPath', "#{XsltXpath.base_url}/XPath" | |
| 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" | |
| 18 | + url.sub! 'https://developer.mozilla.org/en-US/docs/Web/XSLT/Element', "#{XsltXpath.base_url}/XSLT" | |
| 22 | 19 | url |
| 23 | 20 | end |
| 24 | 21 | end |