cask "reqable" do arch arm: "arm64", intel: "x86_64" os macos: "macos", linux: "linux" url_end = on_system_conditional macos: "dmg", linux: "AppImage" version "3.3.4" sha256 arm: "d81c2d20f8aae2f42721671537e8bd582ada53d458cfd964551aabad1430cb81", intel: "28b8d1fcd18a8ffd34a3bb6f7daf34e6847fd04460ca82ce615967d8a819d03d", x86_64_linux: "d5994925770a82d299823d7fdecc55131172af897e971befb26658f4ff76d7a9" on_macos do app "Reqable.app" uninstall_postflight_steps do delete_keychain_certificates "Reqable Proxy" end zap trash: [ "~/Library/Application Support/com.reqable.macosx", "~/Library/Caches/Reqable", "~/Library/Preferences/com.reqable.macosx.plist", ] end on_linux do depends_on arch: :x86_64 app_image "reqable-app-linux-#{arch}.AppImage", target: "Reqable.AppImage" zap trash: "~/.local/share/com.reqable.linux" end url "https://github.com/reqable/reqable-app/releases/download/#{version}/reqable-app-#{os}-#{arch}.#{url_end}" name "Reqable" desc "Advanced API Debugging Proxy" homepage "https://reqable.com/" # Not every GitHub release provides a file for macOS/Linux # so we check multiple recent releases instead of only the "latest" release. livecheck do url :url regex(/^reqable[._-]app[._-]#{os}[._-]#{arch}\.#{url_end}$/i) strategy :github_releases do |json, regex| json.map do |release| next if release["draft"] || release["prerelease"] release["assets"]&.map do |asset| match = asset["name"]&.match(regex) next if match.blank? release["tag_name"]&.[](/^v?(\d+(?:\.\d+)+)$/i, 1) end end.flatten end end auto_updates true end