Skip to content

Commit

Permalink
xprocheck: update livecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
samford committed May 5, 2024
1 parent 3d9ff7d commit aa26cf5
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Casks/x/xprocheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
homepage "https://eclecticlight.co/consolation-t2m2-and-log-utilities/"

livecheck do
url :homepage
regex(%r{href=.*?/(\d+)/(\d+)/xprocheck(\d+)\.zip}i)
strategy :page_match do |page, regex|
page.scan(regex).map do |match|
"#{match[2].split("", 2).join(".")},#{match[0]}.#{match[1]}"
end
url "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist"
regex(%r{/(\d+)/(\d+)/[^/]+?$}i)
strategy :xml do |xml, regex|
item = xml.elements["//dict[key[text()='AppName']/following-sibling::*[1][text()='XProCheck']]"]
next unless item

version = item.elements["key[text()='Version']"]&.next_element&.text&.strip
match = item.elements["key[text()='URL']"]&.next_element&.text&.strip&.match(regex)
next if version.blank? || match.blank?

"#{version},#{match[1]}.#{match[2]}"
end
end

Expand Down

0 comments on commit aa26cf5

Please sign in to comment.