cask "idrive" do version "4.0.0.11,111524" sha256 "fb355cae5e74e59e5aff69851d3c7d0c0f10e27771ef91bfca5ef43fe2b3d3f3" url "https://static.idriveonlinebackup.com/downloads/#{version.csv.second}/IDrive.dmg", verified: "static.idriveonlinebackup.com/downloads/" name "iDrive" desc "Cloud backup and storage solution" homepage "https://www.idrive.com/" # The upstream download page appends a UNIX epoch timestamp (in milliseconds) # to the JavaScript URL, so we do the same (in case it affects the returned data). livecheck do url "https://static.idriveonlinebackup.com/downloads/version_mac.js?v=#{DateTime.now.strftime("%Q")}" strategy :page_match do |page| version_match = page.match(/Version:?\s*v?(\d+(?:\.\d+)+)/i) next if version_match.blank? id_match = page.match(%r{downloads/([^/]+?)/}i) next if id_match.blank? "#{version_match[1]},#{id_match[1]}" end end pkg "IDrive.pkg" uninstall launchctl: [ "com.iDrive.FinderPluginApp", "com.prosoftnet.DaemonHelper", "IDriveDaemon", "IDSyncDaemon", "IDWifiManager", ], quit: [ "com.prosfotnet.IDWifiManager", "com.prosoftnet.IDrive", "com.prosoftnet.IDriveDaemon", "com.prosoftnet.IDriveMonitor", ], pkgutil: "com.profsoftnet.idrive.*" zap trash: [ "/Library/Application Support/IDriveforMac", "~/Library/Application Support/IDriveforMac", "~/Library/Caches/com.prosoftnet.IDriveMonitor", "~/Library/Preferences/com.prosoftnet.IDrive.plist", "~/Library/Preferences/com.prosoftnet.IDriveMonitor.plist", ] end