homebrew-cask/Casks/rubymine.rb

43 lines
1.3 KiB
Ruby

cask "rubymine" do
arch arm: "-aarch64"
version "2022.3.3,223.8836.42"
sha256 arm: "317c9bd172cf7484d57781fafe8d317f6e1478141bbe30ac364aaa48a0cdc692",
intel: "f6583f4c9b9cb3fb1079968565c3f65f6a05329724e1dbb5c29ac348fc86cd9d"
url "https://download.jetbrains.com/ruby/RubyMine-#{version.csv.first}#{arch}.dmg"
name "RubyMine"
desc "Ruby on Rails IDE"
homepage "https://www.jetbrains.com/ruby/"
livecheck do
url "https://data.services.jetbrains.com/products/releases?code=RM&latest=true&type=release"
strategy :json do |json|
json["RM"].map do |release|
"#{release["version"]},#{release["build"]}"
end
end
end
auto_updates true
depends_on macos: ">= :high_sierra"
app "RubyMine.app"
uninstall_postflight do
ENV["PATH"].split(File::PATH_SEPARATOR).map { |path| File.join(path, "mine") }.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/RubyMine#{version.major_minor}",
"~/Library/Caches/RubyMine#{version.major_minor}",
"~/Library/Logs/RubyMine#{version.major_minor}",
"~/Library/Preferences/RubyMine#{version.major_minor}",
]
end