|
| 1 | +cask "rustrover-eap" do |
| 2 | + arch arm: "-aarch64" |
| 3 | + |
| 4 | + version "2026.1,261.21525.29" |
| 5 | + sha256 intel: "b06ffb36014d6f7dafc80fee8cb7ee9568f7071945b9ba0b7895eaa1399d4671", |
| 6 | + arm: "0f8177f584f535d1542a0caa3704f3f20641ca0bce629390e613ccd28804da22" |
| 7 | + |
| 8 | + url "https://download.jetbrains.com/rustrover/RustRover-#{version.csv.second}#{arch}.dmg" |
| 9 | + name "RustRover EAP" |
| 10 | + desc "Rust IDE (EAP)" |
| 11 | + homepage "https://www.jetbrains.com/rust/nextversion/" |
| 12 | + |
| 13 | + livecheck do |
| 14 | + url "https://data.services.jetbrains.com/products/releases?code=RR&latest=true&type=eap" |
| 15 | + strategy :json do |json| |
| 16 | + json["RR"]&.map do |release| |
| 17 | + version = release["version"] |
| 18 | + build = release["build"] |
| 19 | + next if version.blank? || build.blank? |
| 20 | + |
| 21 | + "#{version},#{build}" |
| 22 | + end |
| 23 | + end |
| 24 | + end |
| 25 | + |
| 26 | + auto_updates true |
| 27 | + |
| 28 | + # The application path is often inconsistent between versions |
| 29 | + rename "RustRover*.app", "RustRover EAP.app" |
| 30 | + |
| 31 | + app "RustRover EAP.app" |
| 32 | + binary "#{appdir}/RustRover EAP.app/Contents/MacOS/rustrover", target: "rustrover-eap" |
| 33 | + |
| 34 | + uninstall_postflight do |
| 35 | + ENV["PATH"].split(File::PATH_SEPARATOR).map { |path| File.join(path, "rustrover") }.each do |path| |
| 36 | + if File.readable?(path) && |
| 37 | + File.readlines(path).grep(/# see com.intellij.idea.SocketLock for the server side of this interface/).any? |
| 38 | + File.delete(path) |
| 39 | + end |
| 40 | + end |
| 41 | + end |
| 42 | + |
| 43 | + zap trash: [ |
| 44 | + "~/Library/Application Support/JetBrains/RustRover#{version.csv.first}", |
| 45 | + "~/Library/Caches/JetBrains/RustRover#{version.csv.first}", |
| 46 | + "~/Library/Logs/JetBrains/RustRover#{version.csv.first}", |
| 47 | + "~/Library/Preferences/com.jetbrains.RustRover-EAP.plist", |
| 48 | + "~/Library/Saved Application State/com.jetbrains.RustRover-EAP.savedState", |
| 49 | + ] |
| 50 | +end |
0 commit comments