Merge pull request #200927 from Homebrew/bump-zed-0.172.10
[Homebrew/homebrew-cask.git] / Casks / w / wljs-notebook.rb
blob55a27b468b860a7543fd38cec4c7dde49ffbabfd
1 cask "wljs-notebook" do
2   arch arm: "arm64", intel: "x64"
4   version "2.6.7"
5   sha256 arm:   "c95b6c456aa2a08a0d9f0a31cbb74e85a3a7b3c99da8a65cf5125bf01e5ede56",
6          intel: "e7b952b6e3b7a7cc19d22939578e5be385314e8c836ec9bc395cea74ae2167f7"
8   url "https://github.com/JerryI/wolfram-js-frontend/releases/download/#{version.csv.second || version.csv.first}/wljs-notebook-#{version.csv.first}-#{arch}-macos.dmg",
9       verified: "github.com/JerryI/wolfram-js-frontend/"
10   name "WLJS Notebook"
11   desc "Javascript frontend for Wolfram Engine"
12   homepage "https://jerryi.github.io/wljs-docs/"
14   # The upstream release tag can sometimes differ from the version in the
15   # filename (e.g. 2.5.6FIX vs. 2.5.6), so we include the tag in the cask
16   # `version` when this happens.
17   livecheck do
18     url :url
19     regex(/wljs[._-]notebook[._-]v?(\d+(?:\.\d+)+)[._-]#{arch}(?:[._-]macos)?\.dmg/i)
20     strategy :github_releases do |json, regex|
21       json.map do |release|
22         next if release["draft"] || release["prerelease"]
24         tag = release["tag_name"]
25         tag_version = tag[/^v?(\d+(?:\.\d+)+.*)$/i, 1]
26         next if tag_version.blank?
28         release["assets"]&.map do |asset|
29           match = asset["name"]&.match(regex)
30           next if match.blank?
32           (match[1] == tag_version) ? tag_version : "#{match[1]},#{tag}"
33         end
34       end.flatten
35     end
36   end
38   auto_updates true
39   depends_on macos: ">= :catalina"
41   app "WLJS Notebook.app"
43   zap trash: [
44     "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/wljs-notebook.sfl*",
45     "~/Library/Application Support/wljs-notebook",
46     "~/Library/Preferences/wljs-notebook.plist",
47     "~/Library/Saved Application State/wljs-notebook.savedState",
48   ]
49 end