Skip to content

Commit

Permalink
tableau: update livecheck
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
samford committed Dec 2, 2024
1 parent 251bb0c commit aa8fcc9
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Casks/t/tableau.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(/<section[^>]+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

Expand Down

0 comments on commit aa8fcc9

Please sign in to comment.