cask "alfred@4" do version "4.8,1312" sha256 "dd57e9374e21cd8f6f74628523fd3b0e59d6a40bb24920e5bdf90772d596c486" url "https://cachefly.alfredapp.com/Alfred_#{version.csv.first}_#{version.csv.second}.dmg" name "Alfred" desc "Application launcher and productivity software" homepage "https://www.alfredapp.com/" livecheck do url "https://www.alfredapp.com/app/update#{version.major}/general.xml" strategy :xml do |xml| version = xml.elements["//key[text()='version']"]&.next_element&.text build = xml.elements["//key[text()='build']"]&.next_element&.text next if version.blank? || build.blank? "#{version.strip},#{build.strip}" end end auto_updates true app "Alfred #{version.major}.app" uninstall quit: "com.runningwithcrayons.Alfred" zap trash: [ "~/Library/Application Support/Alfred", "~/Library/Caches/com.runningwithcrayons.Alfred", "~/Library/Cookies/com.runningwithcrayons.Alfred.binarycookies", "~/Library/Preferences/com.runningwithcrayons.Alfred-Preferences.plist", "~/Library/Preferences/com.runningwithcrayons.Alfred.plist", "~/Library/Saved Application State/com.runningwithcrayons.Alfred-Preferences.savedState", ] end