Skip to content

Commit 3d9ff7d

Browse files
committed
xattred: update livecheck
1 parent e99f7ae commit 3d9ff7d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Casks/x/xattred.rb

+11-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99
homepage "https://eclecticlight.co/xattred-sandstrip-xattr-tools/"
1010

1111
livecheck do
12-
url :homepage
13-
regex(%r{href=.*?/(\d+)/(\d+)/xattred(\d+)\.zip}i)
14-
strategy :page_match do |page, regex|
15-
page.scan(regex).map do |match|
16-
"#{match[2].split("", 2).join(".")},#{match[0]}.#{match[1]}"
17-
end
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()='xattred']]"]
16+
next unless item
17+
18+
version = item.elements["key[text()='Version']"]&.next_element&.text&.strip
19+
match = item.elements["key[text()='URL']"]&.next_element&.text&.strip&.match(regex)
20+
next if version.blank? || match.blank?
21+
22+
"#{version},#{match[1]}.#{match[2]}"
1823
end
1924
end
2025

0 commit comments

Comments
 (0)