Look in more places for URL, short version and version.
This commit is contained in:
parent
02849cf3e7
commit
3aa5395f75
@ -58,17 +58,24 @@ module Homebrew
|
|||||||
items = xml.xpath("//rss//channel//item").map do |item|
|
items = xml.xpath("//rss//channel//item").map do |item|
|
||||||
enclosure = (item > "enclosure").first
|
enclosure = (item > "enclosure").first
|
||||||
|
|
||||||
next unless enclosure
|
url = enclosure&.attr("url")
|
||||||
|
short_version = enclosure&.attr("shortVersionString")
|
||||||
|
version = enclosure&.attr("version")
|
||||||
|
|
||||||
short_version ||= enclosure["shortVersionString"]
|
url ||= (item > "link").first&.text
|
||||||
version ||= enclosure["version"]
|
short_version ||= (item > "shortVersionString").first&.text&.strip
|
||||||
|
version ||= (item > "version").first&.text&.strip
|
||||||
|
|
||||||
short_version ||= (item > "shortVersionString").first&.text
|
title = (item > "title").first&.text&.strip
|
||||||
version ||= (item > "version").first&.text
|
|
||||||
|
if match = title&.match(/(\d+(?:\.\d+)*)\s*(\([^)]+\))?\Z/)
|
||||||
|
short_version ||= match[1]
|
||||||
|
version ||= match[2]
|
||||||
|
end
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
title: (item > "title").first&.text,
|
title: title,
|
||||||
url: enclosure["url"],
|
url: url,
|
||||||
bundle_version: short_version || version ? BundleVersion.new(short_version, version) : nil,
|
bundle_version: short_version || version ? BundleVersion.new(short_version, version) : nil,
|
||||||
}.compact
|
}.compact
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user