Refactor Cask#outdated_info
This commit is contained in:
parent
dabbfe3e3e
commit
9a605a1dd6
@ -123,17 +123,18 @@ module Cask
|
|||||||
end
|
end
|
||||||
|
|
||||||
def outdated_info(greedy, verbose, json)
|
def outdated_info(greedy, verbose, json)
|
||||||
|
return token unless verbose || json
|
||||||
|
|
||||||
|
installed_versions = outdated_versions(greedy).join(", ")
|
||||||
|
|
||||||
if json
|
if json
|
||||||
{
|
{
|
||||||
name: token,
|
name: token,
|
||||||
installed_versions: outdated_versions(greedy).join(", "),
|
installed_versions: installed_versions,
|
||||||
current_version: version,
|
current_version: version,
|
||||||
}
|
}
|
||||||
elsif verbose
|
|
||||||
outdated_info = token << " (#{outdated_versions(greedy).join(", ")})"
|
|
||||||
"#{outdated_info} != #{version}"
|
|
||||||
else
|
else
|
||||||
token
|
"#{token} (#{installed_versions}) != #{version}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user