cask "electron-fiddle" do arch arm: "arm64", intel: "x64" version "0.36.4" sha256 arm: "bf0ea16221658138778efe40f8bd65f9e0667f0e797889c6b6fbd1891c612a4c", intel: "ba997d44e6eea61df79e0c75a610933a25af922530d491a02fa1213b04028ee6" url "https://github.com/electron/fiddle/releases/download/v#{version}/Electron.Fiddle-darwin-#{arch}-#{version}.zip", verified: "github.com/electron/fiddle/" name "Electron Fiddle" desc "Create and play with small Electron experiments" homepage "https://www.electronjs.org/fiddle" # Not every GitHub release provides a file for macOS, so we check multiple # recent releases instead of only the "latest" release. livecheck do url :url regex(/^Electron[._-]Fiddle[._-]darwin[._-](?:x64|arm64)[._-]v?(\d+(?:\.\d+)+)\.(?:dmg|pkg|zip)$/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? match[1] end end.flatten end end app "Electron Fiddle.app" zap trash: [ "~/Library/Application Support/Electron Fiddle", "~/Library/Caches/com.electron.fiddle*", "~/Library/Preferences/com.electron.fiddle*.plist", ] end