-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Expand file tree
/
Copy pathmacgamestore.rb
More file actions
38 lines (31 loc) · 1.26 KB
/
macgamestore.rb
File metadata and controls
38 lines (31 loc) · 1.26 KB
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 "macgamestore" do
version "5.7.8,7040"
sha256 "aee1f75a68d93081c97b49d7a3f21764603002d92f2ab92ee299855ad5785872"
url "https://www.macgamestore.com/api_clientapp/clientupdates/public/core#{version.csv.second[0]}/MacGameStore_#{version.csv.first}_#{version.csv.second}.zip"
name "MacGameStore"
desc "Buy, download, and play your games"
homepage "https://www.macgamestore.com/app/"
# This is a Sparkle feed but upstream uses a non-standard approach to
# identify unstable versions that the `Sparkle` strategy doesn't handle, so
# we have to use the `Xml` strategy instead.
livecheck do
url "https://www.macgamestore.com/api_clientapp/clientupdates/public/update-2021.xml"
regex(/MacGameStore[._-]v?(\d+(?:\.\d+)+)[._-](\d+)\.zip/i)
strategy :xml do |xml, regex|
xml.get_elements("//item").map do |item|
next if item.elements["sparkle:isBetaBuild"]&.text&.include?("1")
url = item.elements["enclosure"]&.attributes&.[]("url")
match = url.match(regex) if url
next if match.blank?
"#{match[1]},#{match[2]}"
end
end
end
auto_updates true
depends_on :macos
app "MacGameStore.app"
zap trash: [
"/Applications/MacGameStore",
"~/Library/Application Support/MacGameStore.com",
]
end