cask "rider" do arch arm: "-aarch64" version "2023.2.2,232.9921.83" sha256 arm: "89c30f905216480ba0e379705542d81beac6e7467d26fe3aa882e9b008de42c2", intel: "8fa1c224eccfffe896de8b375160e5d9f63103912f935748199cca758448fc9e" url "https://download.jetbrains.com/rider/JetBrains.Rider-#{version.csv.first}#{arch}.dmg" name "JetBrains Rider" desc ".NET IDE" homepage "https://www.jetbrains.com/rider/" livecheck do url "https://data.services.jetbrains.com/products/releases?code=RD&latest=true&type=release" strategy :json do |json| json["RD"].map do |release| "#{release["version"]},#{release["build"]}" end end end auto_updates true depends_on macos: ">= :high_sierra" app "Rider.app" uninstall_postflight do ENV["PATH"].split(File::PATH_SEPARATOR).map { |path| File.join(path, "rider") }.each do |path| if File.readable?(path) && File.readlines(path).grep(/# see com.intellij.idea.SocketLock for the server side of this interface/).any? File.delete(path) end end end zap trash: [ "~/Library/Application Support/Rider#{version.major_minor}", "~/Library/Caches/Rider#{version.major_minor}", "~/Library/Logs/Rider#{version.major_minor}", "~/Library/Preferences/jetbrains.rider.71e559ef.plist", "~/Library/Preferences/Rider#{version.major_minor}", "~/Library/Saved Application State/com.jetbrains.rider.savedState", ] end