Fix broken get_latest_version implementations

pull/1356/head
Simon Legner 4 years ago
parent 78fb2c812a
commit c0290b816d

@ -75,8 +75,8 @@ module Docs
end end
def get_latest_version(opts) def get_latest_version(opts)
doc = fetch_doc('https://docs.ansible.com/ansible/latest/index.html', opts) tags = get_github_tags('ansible', 'ansible', opts)
doc.at_css('.version').content.strip tags[0]['name'][1..-1]
end end
end end
end end

@ -22,9 +22,7 @@ module Docs
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) get_latest_github_commit_date('mdn', 'content', opts)
dates = json.map { |i| i['pubdate'] }
DateTime.parse(dates.max).to_time.to_i
end end
private private

@ -66,8 +66,7 @@ module Docs
end end
def get_latest_version(opts) def get_latest_version(opts)
html = fetch('https://docs.scipy.org/doc/', opts) get_latest_github_release('numpy', 'numpy', opts)
html.scan(/Numpy ([0-9.]+) Reference Guide/)[0][0]
end end
end end
end end

@ -34,7 +34,7 @@ module Docs
end end
def get_latest_version(opts) def get_latest_version(opts)
get_latest_github_release('vuejs', 'vue', opts) get_latest_github_release('vuejs', 'vue-next', opts)
end end
end end
end end

Loading…
Cancel
Save