eudic: update livecheck

Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
Rui Chen
2024-02-14 13:12:42 +01:00
parent 70c6b14c94
commit c2cb696ff9
+4 -13
View File
@@ -1,8 +1,8 @@
cask "eudic" do
version "4.6.1,2024-01-10"
sha256 "d47f28d44082d889082cde3e812f19939c46b99ba56ca1dfa013760a586f539a"
version "4.6.1"
sha256 :no_check
url "https://static.frdic.com/pkg/eudicmac.dmg?v=#{version.csv.second}",
url "https://static.frdic.com/pkg/eudicmac.dmg",
verified: "static.frdic.com/",
user_agent: :fake
name "Eudic"
@@ -12,16 +12,7 @@ cask "eudic" do
livecheck do
url "https://www.eudic.net/update/eudic_mac.xml"
regex(/href=.*?eudicmac\.dmg\?v=(\d+(?:-\d+)+)/i)
strategy :sparkle do |item, regex|
download_page = Homebrew::Livecheck::Strategy.page_content("https://www.eudic.net/v4/en/app/download")
next if download_page[:content].blank?
match = download_page[:content].match(regex)
next if match.blank?
"#{item.short_version},#{match[1]}"
end
strategy :sparkle, &:short_version
end
depends_on macos: ">= :high_sierra"