cask "tolaria" do arch arm: "Silicon", intel: on_system_conditional(macos: "Intel", linux: "amd64") os macos: "_macOS_#{arch}.dmg", linux: "_#{arch}.AppImage" version "2027.08.28,2027.8.28" sha256 arm: "b57971df0544d06f48d85b0ad62cc8b98b1b6442fd510cfcdc4905ec4e8919b6", intel: "b70b25f97fd4da9888db9d7ca3b75adc35e2ae3dd870bbcdb73eaf882ba701c8", x86_64_linux: "fb64c042fbf818c744307cea175dabef8b8ad3b02f1a123bf5edcbf4ecc8c00d" on_macos do auto_updates true app "Tolaria.app" uninstall quit: "club.refactoring.tolaria" zap trash: [ "~/.config/com.tolaria.app", "~/Library/Application Support/com.tolaria.app", "~/Library/Caches/club.refactoring.tolaria", "~/Library/Preferences/club.refactoring.tolaria.plist", "~/Library/WebKit/club.refactoring.tolaria", ] end on_linux do depends_on arch: :x86_64 app_image "Tolaria_#{version.csv.second || version}_#{arch}.AppImage", target: "Tolaria.AppImage" end url "https://github.com/refactoringhq/tolaria/releases/download/v#{version.csv.first.dots_to_hyphens}/Tolaria_#{version.csv.second || version}#{os}" name "Tolaria" desc "Markdown knowledgebase manager" homepage "https://tolaria.md/" # The version formatting in the tag name can be inconsistent # with the version in the asset name, so we need to compare # both and return them in the version if they don't match. livecheck do url :url regex(/Tolaria[._-]v?(\d+(?:\.\d+)+)#{os}/i) strategy :github_latest do |json, regex| tag_version = json["tag_name"]&.tr("-", ".")&.gsub(/^v/, "") next if tag_version.blank? json["assets"]&.map do |asset| match = asset["name"]&.match(regex) next if match.blank? (match[1] == tag_version) ? tag_version : "#{tag_version},#{match[1]}" end end end end