cask "telegram" do version "11.4,269400" sha256 "759e7f274f15d321ffbe44274fb1153c6c638788e4d4c952b1ea5ca5d961b2ab" url "https://osx.telegram.org/updates/Telegram-#{version.csv.first}.#{version.csv.second}.app.zip" name "Telegram for macOS" desc "Messaging app with a focus on speed and security" homepage "https://macos.telegram.org/" livecheck do url "https://osx.telegram.org/updates/versions.xml" regex(/Telegram[._-]v?(\d+(?:\.\d+)+)\.(\d{4,})\.app\.zip/i) strategy :sparkle do |items, regex| items.map do |item| match = item.url.match(regex) next if match.blank? "#{match[1]},#{match[2]}" end end end auto_updates true depends_on macos: ">= :high_sierra" app "Telegram.app" uninstall quit: "ru.keepcoder.Telegram" zap trash: [ "~/Library/Application Scripts/*.ru.keepcoder.Telegram", "~/Library/Application Scripts/*.ru.keepcoder.Telegram.TelegramShare", "~/Library/Application Scripts/ru.keepcoder.Telegram", "~/Library/Application Scripts/ru.keepcoder.Telegram.TelegramShare", "~/Library/Application Support/ru.keepcoder.Telegram", "~/Library/Caches/com.plausiblelabs.crashreporter.data/ru.keepcoder.Telegram", "~/Library/Caches/ru.keepcoder.Telegram", "~/Library/Containers/ru.keepcoder.Telegram", "~/Library/Containers/ru.keepcoder.Telegram.TelegramShare", "~/Library/Cookies/ru.keepcoder.Telegram.binarycookies", "~/Library/Group Containers/*.ru.keepcoder.Telegram", "~/Library/Group Containers/*.ru.keepcoder.Telegram.TelegramShare", "~/Library/HTTPStorages/ru.keepcoder.Telegram", "~/Library/Preferences/ru.keepcoder.Telegram.plist", "~/Library/Saved Application State/ru.keepcoder.Telegram.savedState", ] end