cask "mixed-in-key" do version "11.0.5.6054,67" sha256 "66a9d57d47fd436715fdc36f1e005a3aa23eaeeb681e9c82dc1faf2d9ca4cb37" url "https://builds.mixedinkey.com/download/#{version.csv.second}/release/latest?key=public" name "Mixed In Key" desc "Harmonic mixing for DJs and music producers" homepage "https://mixedinkey.com/get#{version.major}/" # The version for the latest file can only be found by checking the headers # (`Location` or `Content-Disposition`) of the unversioned URL for the latest # file. This URL includes a numeric ID that varies based on major version and # platform (Mac, Windows). The upstream download page is specific to a given # major version, so we have to fetch multiple pages to identify the current # URL for the latest file. livecheck do url "https://shop.mixedinkey.com" regex(/Mixed(?:%2B|[+._-])In(?:%2B|[+._-])Key[._-]v?(\d+(?:\.\d+)+)/i) strategy :page_match do |page, regex| # Find the current major version major_version = page[/Mixed\s+in\s+Key\s+v?(\d+)\s*= :high_sierra" app "Mixed In Key #{version.major}.app" uninstall quit: "com.mixedinkey.application" zap trash: [ "~/Library/Application Support/com.mixedinkey.application", "~/Library/Application Support/Mixedinkey", "~/Library/Caches/com.mixedinkey.application", "~/Library/HTTPStorages/com.mixedinkey.application", "~/Library/Preferences/com.mixedinkey.application.plist", "~/Library/Saved Application State/com.mixedinkey.application.savedState", "~/Library/WebKit/com.mixedinkey.application", ] end