cask "mixed-in-key" do version "11.2.3.7353,67" sha256 "c718902402ae20cd506989c9c330e2f7c9e758fadc64e41584f6683cb3479f4f" 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