cask "geogebra" do version "6.0.866.0" sha256 "9f5a30aa7844e502b226bafcc3baa044a386ca15803e760852cc703bfe8a7a21" url "https://download.geogebra.org/installers/#{version.major_minor}/GeoGebra-Classic-#{version.major}-MacOS-Portable-#{version.dots_to_hyphens}.zip" name "GeoGebra" desc "Solve, save and share math problems, graph functions, etc" homepage "https://www.geogebra.org/" livecheck do url "https://download.geogebra.org/package/mac-port" regex(%r{[^/]+?v?(\d+(?:[.-]\d+)+)[^/]+?$}i) strategy :header_match do |headers, regex| match = headers["location"]&.match(regex) next if match.blank? match[1].tr("-", ".") end end auto_updates true app "GeoGebra Classic #{version.major}.app" uninstall quit: "org.geogebra.mathapps", login_item: "GeoGebra", pkgutil: "org.geogebra6.mac" zap trash: [ "~/Library/GeoGebra", "~/Library/Preferences/org.geogebra.mathapps.helper.plist", "~/Library/Preferences/org.geogebra.mathapps.plist", "~/Library/Saved Application State/org.geogebra.mathapps.savedState", ] end