cask "wpsoffice-cn" do arch arm: "arm64", intel: "x64" version "6.13.2,8918" sha256 arm: "4fa02873cf0637145e5eeffa9c635193ebd060e978ead9326df48d4fd057cce4", intel: "0b7855997e6288f530aa40dbb01f3890a73f36ddc5917f60503ecff8768599a5" url "https://package.mac.wpscdn.cn/mac_wps_pkg/#{version.csv.first}/WPS_Office_#{version.csv.first}(#{version.csv.second})_#{arch}.dmg", verified: "package.mac.wpscdn.cn/mac_wps_pkg/" name "WPS Office" desc "All-in-one office service platform in Chinese" homepage "https://mac.wps.cn/" livecheck do url :homepage regex(%r{>\s*v?(\d+(?:\.\d+)+)\s*[_\uff08(](\d+)[_\uff09)]\s*/\s*\d+(?:\.\d+)*\s*<}im) strategy :page_match do |page, regex| page.scan(regex).map { |match| "#{match[0]},#{match[1]}" } end end conflicts_with cask: "wpsoffice" depends_on macos: ">= :sierra" app "wpsoffice.app" zap trash: [ "~/Library/Application Scripts/com.kingsoft.wpsoffice.mac", "~/Library/Application Scripts/com.kingsoft.wpsoffice.mac.FinderSync", "~/Library/Application Scripts/com.kingsoft.wpsoffice.mac.recentfiles", "~/Library/Application Scripts/com.kingsoft.wpsoffice.mac.WPSFinderMenu", "~/Library/Application Scripts/YK4WKE5WAM.wpsoffice", "~/Library/Containers/com.kingsoft.wpsoffice.mac", "~/Library/Containers/com.kingsoft.wpsoffice.mac.FinderSync", "~/Library/Containers/com.kingsoft.wpsoffice.mac.recentfiles", "~/Library/Containers/com.kingsoft.wpsoffice.mac.WPSFinderMenu", "~/Library/Containers/YK4WKE5WAM.wpsoffice", ] end