<commit_before>cask "anki-beta" do
  arch arm: "apple", intel: "intel"

  version "2.1.54+rc3_a8e34ce4"

  if Hardware::CPU.intel?
    sha256 "05c02714d2f71ee6cc7b1332f7c90e10e88df4a3e23f07336817cb15bd0c71b5"
  else
    sha256 "1094c787826295aace1a89c624516aa48c9d533375db8cba82f694d2e0424fe9"
  end

  url "https://apps.ankiweb.net/downloads/beta/anki-#{version}-mac-#{arch}-qt6.dmg"
  name "Anki Beta"
  desc "Memory training application"
  homepage "https://apps.ankiweb.net/"

  livecheck do
    url "https://apps.ankiweb.net/downloads/beta/?C=N&O=D"
    # It looks for title instead of href because "+" character in version number
    # is escaped to %2B in href:
    regex(/title=["']?anki[._-]?(\d+\.\d+.\d+\+rc\d+_[a-f0-9]+)-mac(?:-#{arch})?(?:-qt\d+)?\.dmg["'\s>]/i)
  end

  conflicts_with cask: "anki"
  depends_on macos: ">= :big_sur"

  app "Anki.app"

  zap trash: "~/Library/Application Support/Anki*"
end
<commit_msg>anki-beta: use `on_intel` and `on_arm` blocks<commit_after>cask "anki-beta" do
  arch arm: "apple", intel: "intel"

  version "2.1.54+rc3_a8e34ce4"

  on_intel do
    sha256 "05c02714d2f71ee6cc7b1332f7c90e10e88df4a3e23f07336817cb15bd0c71b5"
  end
  on_arm do
    sha256 "1094c787826295aace1a89c624516aa48c9d533375db8cba82f694d2e0424fe9"
  end

  url "https://apps.ankiweb.net/downloads/beta/anki-#{version}-mac-#{arch}-qt6.dmg"
  name "Anki Beta"
  desc "Memory training application"
  homepage "https://apps.ankiweb.net/"

  livecheck do
    url "https://apps.ankiweb.net/downloads/beta/?C=N&O=D"
    # It looks for title instead of href because "+" character in version number
    # is escaped to %2B in href:
    regex(/title=["']?anki[._-]?(\d+\.\d+.\d+\+rc\d+_[a-f0-9]+)-mac(?:-#{arch})?(?:-qt\d+)?\.dmg["'\s>]/i)
  end

  conflicts_with cask: "anki"
  depends_on macos: ">= :big_sur"

  app "Anki.app"

  zap trash: "~/Library/Application Support/Anki*"
end

{'fraction_non_alphanumeric': 0.17079599367422246, 'fraction_numerical': 0.10859251449657353, 'mean_word_length': 4.021164021164021, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3902530', 'n_tokens_mistral': 940, 'n_tokens_neox': 841, 'n_words': 139}