excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / l / lockrattler.rb
blob15c8a0bf40ccf242f1ef075b0a1807ec05a6e8f9
1 cask "lockrattler" do
2   version "4.37,2023.05"
3   sha256 "e0313e7116136d98201c01b09eefe3a221889579debe68457e88488bfa60b78e"
5   url "https://eclecticlightdotcom.files.wordpress.com/#{version.csv.second.major}/#{version.csv.second.minor}/lockrattler#{version.csv.first.no_dots}.zip",
6       verified: "eclecticlightdotcom.files.wordpress.com/"
7   name "Lock Rattler"
8   desc "Checks security systems and reports issues"
9   homepage "https://eclecticlight.co/lockrattler-systhist/"
11   livecheck do
12     url "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist"
13     regex(%r{/(\d+)/(\d+)/[^/]+?$}i)
14     strategy :xml do |xml, regex|
15       item = xml.elements["//dict[key[text()='AppName']/following-sibling::*[1][text()='LockRattler']]"]
16       next unless item
18       version = item.elements["key[text()='Version']"]&.next_element&.text
19       url = item.elements["key[text()='URL']"]&.next_element&.text
20       match = url.strip.match(regex) if url
21       next if version.blank? || match.blank?
23       "#{version.strip},#{match[1]}.#{match[2]}"
24     end
25   end
27   depends_on macos: ">= :high_sierra"
29   app "lockrattler#{version.csv.first.major}#{version.csv.first.minor}/LockRattler.app"
31   zap trash: [
32     "~/Library/Caches/co.eclecticlight.LockRattler",
33     "~/Library/HTTPStorages/co.eclecticlight.LockRattler",
34     "~/Library/Preferences/co.eclecticlight.LockRattler.plist",
35     "~/Library/Saved Application State/co.eclecticlight.LockRattler.savedState",
36   ]
37 end