Don't pass nice_version to block.

This commit is contained in:
Markus Reiter 2020-12-14 10:34:14 +01:00 committed by Sam Ford
parent d3e2a98136
commit 02849cf3e7
No known key found for this signature in database
GPG Key ID: 95209E46C7FFDEFE

View File

@ -69,20 +69,21 @@ module Homebrew
data = { data = {
title: (item > "title").first&.text, title: (item > "title").first&.text,
url: enclosure["url"], url: enclosure["url"],
version: short_version || version ? BundleVersion.new(short_version, version) : nil, bundle_version: short_version || version ? BundleVersion.new(short_version, version) : nil,
}.compact }.compact
data unless data.empty? data unless data.empty?
end.compact end.compact
item = items.max_by { |e| e[:version] } item = items.max_by { |e| e[:bundle_version] }
if item if item
match = if block match = if block
item[:version] = item[:version]&.nice_version item[:short_version] = item[:bundle_version]&.short_version
item[:version] = item[:bundle_version]&.version
block.call(item).to_s block.call(item).to_s
else else
item[:version]&.nice_version item[:bundle_version]&.nice_version
end end
match_data[:matches][match] = Version.new(match) if match match_data[:matches][match] = Version.new(match) if match