Add per-os versions to Cask::Cask#to_h

This commit is contained in:
Rylan Polster 2021-08-24 11:35:19 -04:00
parent a1e34bdd10
commit 663cc40139
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64

View File

@ -81,6 +81,21 @@ module Cask
.reverse .reverse
end end
def os_versions
@os_versions ||= begin
version_os_hash = {}
actual_version = MacOS.full_version.to_s
MacOS::Version::SYMBOLS.each do |os_name, os_version|
MacOS.full_version = os_version
version_os_hash[os_name] = CaskLoader.load(token).version
end
MacOS.full_version = actual_version
version_os_hash
end
end
def full_name def full_name
return token if tap.nil? return token if tap.nil?
return token if tap.user == "Homebrew" return token if tap.user == "Homebrew"
@ -181,6 +196,7 @@ module Cask
"url" => url, "url" => url,
"appcast" => appcast, "appcast" => appcast,
"version" => version, "version" => version,
"versions" => os_versions,
"installed" => versions.last, "installed" => versions.last,
"outdated" => outdated?, "outdated" => outdated?,
"sha256" => sha256, "sha256" => sha256,