|
|
@ -17,18 +17,20 @@ module Docs
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
options[:attribution] = <<-HTML
|
|
|
|
options[:attribution] = <<-HTML
|
|
|
|
© 2005–2018 Mozilla Developer Network and individual contributors.<br>
|
|
|
|
© 2005–2020 Mozilla and individual contributors.<br>
|
|
|
|
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
|
|
|
|
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
|
|
|
|
HTML
|
|
|
|
HTML
|
|
|
|
|
|
|
|
|
|
|
|
def get_latest_version(opts)
|
|
|
|
def get_latest_version(opts)
|
|
|
|
json = fetch_json("https://developer.mozilla.org/en-US/docs/feeds/json/tag/#{options[:mdn_tag]}", opts)
|
|
|
|
json = fetch_json("https://developer.mozilla.org/en-US/docs/feeds/json/tag/#{options[:mdn_tag]}", opts)
|
|
|
|
DateTime.parse(json[0]['pubdate']).to_time.to_i
|
|
|
|
dates = json.map { |i| i['pubdate'] }
|
|
|
|
|
|
|
|
DateTime.parse(dates.max).to_time.to_i
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
|
|
def process_response?(response)
|
|
|
|
def process_response?(response)
|
|
|
|
|
|
|
|
response.effective_url.host = 'developer.mozilla.org' if response.effective_url.host == 'wiki.developer.mozilla.org'
|
|
|
|
super && response.effective_url.query == 'raw=1¯os=1'
|
|
|
|
super && response.effective_url.query == 'raw=1¯os=1'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|