archaeology: update livecheck

This commit is contained in:
Sam Ford 2024-05-13 18:00:56 -04:00
parent 37fdd3407e
commit ee7e4e68a8
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D
1 changed files with 6 additions and 3 deletions

View File

@ -9,9 +9,12 @@ cask "archaeology" do
livecheck do
url "https://www.mothersruin.com/software/Archaeology/data/ArchaeologyVersionInfo.plist"
regex(/CFBundleShortVersionString.*?\n.*?(\d+(?:\.\d+)*).*?\n.*?CFBundleVersion.*?\n.*?(\d+(?:\.\d+)*)/i)
strategy :page_match do |page, regex|
page.scan(regex).map { |match| "#{match[0]},#{match[1]}" }
strategy :xml do |xml|
short_version = xml.elements["//key[text()='CFBundleShortVersionString']"]&.next_element&.text&.strip
version = xml.elements["//key[text()='CFBundleVersion']"]&.next_element&.text&.strip
next if short_version.blank? || version.blank?
"#{short_version},#{version}"
end
end