From 482a57e5e04598f94961c265a49ffdb69233ed47 Mon Sep 17 00:00:00 2001 From: Bevan Kay Date: Wed, 6 Dec 2023 23:37:34 +1100 Subject: [PATCH] cinebench 2024 --- Casks/c/cinebench.rb | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/Casks/c/cinebench.rb b/Casks/c/cinebench.rb index 228c68504d..d033673400 100644 --- a/Casks/c/cinebench.rb +++ b/Casks/c/cinebench.rb @@ -1,6 +1,6 @@ cask "cinebench" do version "2024" - sha256 "dcc840852c85c2f9ea39f55e78b23efbb59a27960555c0fb319d5bce7f51fdb6" + sha256 "abd8533154d54cb74dc005226177767b7f16d6e647a0cc075a2f45854d3887ea" url "https://mx-app-blob-prod.maxon.net/mx-package-production/website/macos/maxon/cinebench/Cinebench#{version}_macOS.dmg", referer: "https://www.maxon.net/en/downloads/cinebench-#{version}-downloads" @@ -8,27 +8,9 @@ cask "cinebench" do desc "Hardware benchmarking utility" homepage "https://www.maxon.net/products/cinebench/" - # The content of the Downloads page is kept in a `payload.js` file but the - # URL contains a numeric identifier that changes when the website is updated. - # As such, we have to identify the JS file URL from the Downloads page HTML - # before fetching and checking the JS file for version information. livecheck do url "https://www.maxon.net/en/downloads" regex(/cinebench-?[rv]?(\d+(?:\.\d+)*)-downloads/i) - strategy :page_match do |page, regex| - # Find the current JS file URL on the Downloads page - js_match = page.match(%r{href=["']?([^"' >]+?/en/downloads/payload.js[^"' >]*?)}i) - next if js_match.blank? - - # Fetch the JS file (using the absolute URL) - js_response = Homebrew::Livecheck::Strategy.page_content( - URI.join(@url, js_match[1]).to_s, - ) - next if (js_content = js_response[:content]).blank? - - # Identify the version from the versioned downloads page URL - js_content.scan(regex).map { |match| match[0] } - end end depends_on macos: ">= :big_sur"