cask "kate" do arch arm: "arm64", intel: "x86_64" sha256 arm: "5dfaee23a31fa920417357c0c7a92c9da4881ded8b6f214983f380b58cb70cf2", intel: "d2c385e21433bf73604e6c603fc130f9a86c57c2b3e8e9d5f0f1d8a6664a5170" on_arm do version "26.08,12388" end on_intel do version "26.08,12388" end url "https://cdn.kde.org/ci-builds/utilities/kate/release-#{version.csv.first}/macos-#{arch}/kate-release_#{version.csv.first}-#{version.csv.second}-macos-clang-#{arch}.dmg" name "Kate" desc "Multi-document editor by KDE" homepage "https://kate-editor.org/" livecheck do url "https://cdn.kde.org/ci-builds/utilities/kate/" regex(/href=.*?kate-release[._-]v?(\d+(?:[.-]\d+)+)[^"' >]*?[._-]#{arch}\.dmg/i) strategy :page_match do |page, regex| # Find the release directory with the highest version release_dir = page.scan(%r{href=["']?(release[._-]v?(\d+(?:\.\d+)*))/?["' >]}i) .max_by { |match| Version.new(match[1]) } &.first next unless release_dir # Fetch the release directory listing page builds_page = Homebrew::Livecheck::Strategy.page_content( "https://cdn.kde.org/ci-builds/utilities/kate/#{release_dir}/macos-#{arch}/", ) next if (builds_content = builds_page[:content]).blank? builds_content.scan(regex).map { |match| match[0].tr("-", ",") } end end depends_on macos: :ventura app "kate.app" command_wrapper "kate", executable: "#{appdir}/Kate.app/Contents/MacOS/kate" zap trash: [ "~/Library/Application Support/kate", "~/Library/Caches/kate", "~/Library/Preferences/org.kde.kate.plist", "~/Library/Saved Application State/org.kde.kate.savedState", ] end