<commit_before>cask "hook" do
  version "2.2.2,2021-03"
  sha256 "75acc69d06d68082d5fad6679b57e0a06e46dddffef921e6a02cabb6221e233e"

  url "https://hookproductivity.com/wp-content/uploads/#{version.after_comma.tr("-", "/")}/Hook-productivity-app-#{version.before_comma}.dmg"
  name "Hook"
  desc "Link and retrieve key information"
  homepage "https://hookproductivity.com/"

  livecheck do
    url :homepage
    strategy :page_match do |page|
      match = page.match(%r{href=.*?/(\d+)/(\d+)/Hook-productivity-app-(\d+(?:\.\d+)*)\.dmg}i)
      "#{match[3]},#{match[1]}-#{match[2]}"
    end
  end

  auto_updates true

  app "Hook.app"

  uninstall launchctl: "com.cogsciapps.hookautolaunchhelper",
            quit:      "com.cogsciapps.hook"

  zap trash: [
    "~/Library/Caches/com.cogsciapps.hook",
    "~/Library/Logs/com.cogsciapps.hook",<commit_msg>Update hook from 2.2.2,2021-03 to 3.0-4312-1,2021.05 (#105177)<commit_after>cask "hook" do
  version "3.0-4312-1,2021.05"
  sha256 "6629af835caf5de482f636ba5754564c8da2b2ab5367a68c5d794bbf17057eb3"

  url "https://hookproductivity.com/wp-content/uploads/#{version.after_comma.major}/#{version.after_comma.minor}/Hook-productivity-app-#{version.before_comma}.dmg"
  name "Hook"
  desc "Link and retrieve key information"
  homepage "https://hookproductivity.com/"

  livecheck do
    url :homepage
    strategy :page_match do |page|
      match = page.match(%r{href=.*?/(\d+)/(\d+)/Hook-productivity-app-(\d+(?:\.\d+)*(?:-\d+)*)\.dmg}i)
      "#{match[3]},#{match[1]}.#{match[2]}"
    end
  end

  auto_updates true

  app "Hook.app"

  uninstall launchctl: "com.cogsciapps.hookautolaunchhelper",
            quit:      "com.cogsciapps.hook"

  zap trash: [
    "~/Library/Caches/com.cogsciapps.hook",
    "~/Library/Logs/com.cogsciapps.hook",
{'fraction_non_alphanumeric': 0.1812117843246248, 'fraction_numerical': 0.07670928293496387, 'mean_word_length': 3.7244094488188977, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2915442', 'n_tokens_mistral': 817, 'n_tokens_neox': 745, 'n_words': 96}