-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
/
surge.rb
38 lines (31 loc) · 1.18 KB
/
surge.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
cask "surge" do
version "5.7.1,2758,f5ff0b10bf04ff39a861da762eb144af"
sha256 "18f5131cca34ce6382ff87b1fc68cc1e8420ae99be657d7cf49810e44938a4d3"
url "https://dl.nssurge.com/mac/v#{version.major}/Surge-#{version.tr(",", "-")}.zip"
name "Surge"
desc "Network toolbox"
homepage "https://nssurge.com/"
livecheck do
url "https://www.nssurge.com/mac/v#{version.major}/appcast-signed.xml"
strategy :sparkle do |item|
match = item.url.match(/[._-](\d+(?:\.\d+)+)[._-](\d+)[._-](\h+)\.zip/i)
next if match.blank?
"#{match[1]},#{match[2]},#{match[3]}"
end
end
auto_updates true
conflicts_with cask: "surge4"
depends_on macos: ">= :high_sierra"
app "Surge.app"
uninstall launchctl: "com.nssurge.surge-mac.helper",
delete: "/Library/PrivilegedHelperTools/com.nssurge.surge-mac.helper"
zap delete: [
"~/Library/Application Support/com.nssurge.surge-mac",
"~/Library/Application Support/Surge",
"~/Library/Caches/com.nssurge.surge-mac*",
"~/Library/HTTPStorages/com.nssurge.surge-mac",
"~/Library/Logs/Surge",
"~/Library/Preferences/com.nssurge.surge*",
"~/Library/Saved Application State/com.nssurge.surge*",
]
end