From 251bb0c782ba1b1e69aa0034282bfccd1c4472d2 Mon Sep 17 00:00:00 2001 From: Okky Mabruri <57498478+okkymabruri@users.noreply.github.com> Date: Sun, 1 Dec 2024 19:53:42 +0700 Subject: [PATCH 1/2] tableau 2024.3.1 and update livecheck strategy --- Casks/t/tableau.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Casks/t/tableau.rb b/Casks/t/tableau.rb index 7116f0df0ba6..a25ade78fdb3 100644 --- a/Casks/t/tableau.rb +++ b/Casks/t/tableau.rb @@ -1,9 +1,9 @@ cask "tableau" do arch arm: "-arm64" - version "2024.2.4" - sha256 arm: "f2524f6db177bbc4ef639f519c98e4e59fcde8f7aa84aa2ff77e5062228121d0", - intel: "f496583c475601f9a9f0993b2fa7f53d6f9f502efa7ce6d5ba8498076cb606e3" + version "2024.3.1" + sha256 arm: "cf6a00486ae06716f41cf1552425fea296ab227ed3cbd38febaa09b9c563b528", + intel: "f98a2631784242eccd68e4a41707d9b0d3aaee6ec9b40dea9847bb724f5d34d4" url "https://downloads.tableau.com/esdalt/#{version}/TableauDesktop-#{version.dots_to_hyphens}#{arch}.dmg", user_agent: "curl/8.7.1" @@ -12,9 +12,10 @@ homepage "https://www.tableau.com/products/desktop" livecheck do - url "https://downloads.tableau.com/TableauAutoUpdate.xml" - strategy :xml do |xml| - xml.get_elements("//version").map { |item| item.attributes["releaseNotesVersion"] } + url "https://www.tableau.com/app/discover/desktop" + strategy :page_match do |page| + match = page.match(/]+data-version-before=["'](\d+\.\d+\.\d+)["']/i) + match[1] if match end end From aa8fcc91bbc0075cbad2c0d648a88e3822d320aa Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:54:02 -0500 Subject: [PATCH 2/2] tableau: update livecheck The previous `livecheck` block for `tableau` checked an XML file that contained version information for Tableau Desktop but it hasn't been updated for 2024.3.x releases. This updates the `livecheck` block to check the upstream Releases page for now, as it contains version information for the newest versions (e.g., 2024.3.0, 2024.3.1). --- Casks/t/tableau.rb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Casks/t/tableau.rb b/Casks/t/tableau.rb index a25ade78fdb3..a0755e89b455 100644 --- a/Casks/t/tableau.rb +++ b/Casks/t/tableau.rb @@ -11,11 +11,22 @@ desc "Data visualization software" homepage "https://www.tableau.com/products/desktop" + # This checks the upstream Releases page because the XML file we were checking + # (https://downloads.tableau.com/TableauAutoUpdate.xml) was missing the newest + # versions. This check works locally but fails in our CI environment, so we + # should return to checking the XML file if/when it starts being reliably + # updated to include the newest releases again. livecheck do - url "https://www.tableau.com/app/discover/desktop" - strategy :page_match do |page| - match = page.match(/]+data-version-before=["'](\d+\.\d+\.\d+)["']/i) - match[1] if match + url "https://www.tableau.com/support/releases" + regex(%r{href=.*?desktop/v?(\d+(?:\.\d+)+)[^"' >]*["' >]}i) + strategy :page_match do |page, regex| + page.scan(regex).map do |match| + if (version = match[0]).count(".") >= 2 + version + else + "#{version}.0" + end + end end end