cask "cockatrice" do on_monterey :or_older do version "2.9.0,2023-09-14,Rings.of.the.Wild" sha256 "4524c5b95928e88073d1f8be46d881288d6d0bf07d8e65185fbebc0491f29e08" url "https://github.com/Cockatrice/Cockatrice/releases/download/#{version.csv.second}-Release-#{version.csv.first}/Cockatrice-#{version.csv.third}-#{version.csv.first}-macOS-11_Big_Sur.dmg" livecheck do skip "Legacy version" end disable! date: "2026-09-01", because: :fails_gatekeeper_check caveats do requires_rosetta end end on_ventura :or_newer do version "3.1.1,2026-10-10,Reality-Check,3.1.1" on_ventura do sha256 "4137a2021c97ef47f514b44898bc3897c1448698962dcad1f4d8482632e57bb8" url "https://github.com/Cockatrice/Cockatrice/releases/download/#{version.csv.second}-Release-#{version.csv.first}/Cockatrice-#{version.csv.third}-#{version.csv.fourth}-macOS13_Intel.dmg" caveats do requires_rosetta end end on_sonoma do sha256 "53bc76f1e0291af6e53c6989c6811561a7fe3f64aea574e4826ae00e370da98d" url "https://github.com/Cockatrice/Cockatrice/releases/download/#{version.csv.second}-Release-#{version.csv.first}/Cockatrice-#{version.csv.third}-#{version.csv.fourth}-macOS14.dmg" end on_sequoia :or_newer do sha256 "b7460d315d28c533670db41341b367c3900b33368d80ff1cc887d308c37076f7" url "https://github.com/Cockatrice/Cockatrice/releases/download/#{version.csv.second}-Release-#{version.csv.first}/Cockatrice-#{version.csv.third}-#{version.csv.fourth}-macOS15.dmg" end livecheck do url :url regex(%r{/(\d+(?:-\d+)+)-Release-([^/]+)/Cockatrice-(.+?)-(\d+(?:\.\d+)+(?:-beta)?)-macOS[.\w]*\.dmg$}i) strategy :github_latest do |json, regex| json["assets"]&.map do |asset| match = asset["browser_download_url"]&.match(regex) next if match.blank? "#{match[2]},#{match[1]},#{match[3]},#{match[4]}" end end end end name "Cockatrice" desc "Virtual tabletop for multiplayer card games" homepage "https://cockatrice.github.io/" depends_on :macos app "Cockatrice.app" app "oracle.app" app "servatrice.app" uninstall quit: [ "com.cockatrice.cockatrice", "com.cockatrice.oracle", "com.cockatrice.servatrice", ] zap trash: [ "~/Library/Application Support/Cockatrice", "~/Library/Preferences/com.cockatrice.Cockatrice.plist", "~/Library/Preferences/com.cockatrice.oracle.plist", "~/Library/Preferences/de.cockatrice.Cockatrice.plist", "~/Library/Saved Application State/com.cockatrice.cockatrice.savedState", "~/Library/Saved Application State/com.cockatrice.oracle.savedState", ] end