<commit_before>class Dune < Formula
  desc "Composable build system for OCaml"
  homepage "https://dune.build/"
  url "https://github.com/ocaml/dune/releases/download/3.6.1/dune-3.6.1.tbz"
  sha256 "f1d5ac04b7a027f3d549e25cf885ebf7acc135e0291c18e6b43123a799c143ce"
  license "MIT"
  head "https://github.com/ocaml/dune.git", branch: "main"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_ventura:  "d3b09ec67756894cf1ad0ecc7a280324b5f694e1993eda3fed20c554c16ac558"
    sha256 cellar: :any_skip_relocation, arm64_monterey: "22356cee578225e906d0982b0c04a38bf395c4f5249ac5c0e94a3fb54bd938c2"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "ea8092effe61342886b35d1de52d4e18d4d21ab4bc39328b6da4d75d1081a916"
    sha256 cellar: :any_skip_relocation, monterey:       "26e36453b741b5c6f5f307cfeb3b8047e4d6afd75a2d5137264896b596257163"
    sha256 cellar: :any_skip_relocation, big_sur:        "c496303691c6dc59a2e335195bb85e13317c06ef3d847ba29763318eb994ef3f"
    sha256 cellar: :any_skip_relocation, catalina:       "27cebca2a88cc76390958a7f55dacb65543b451037312045eed5991f572e3780"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "4aec348495d251736d17ae2cf030cd095b529629e6123c88f713dfaf1f1d8205"
  end

  depends_on "ocaml" => [:build, :test]

  def install
    system "make", "release"
    system "make", "PREFIX=#{prefix}", "install"
    share.install prefix/"man"
    elisp.install Dir[share/"emacs/site-lisp/*"]
  end

  test do
    contents = "bar"
    target_fname = "foo.txt"
    (testpath/"dune").write("(rule (with-stdout-to #{target_fname} (echo #{contents})))")
    system bin/"dune", "build", "foo.txt", "--root", "."
    output = File.read(testpath/"_build/default/#{target_fname}")
    assert_match contents, output<commit_msg>dune: update 3.6.1 bottle.<commit_after>class Dune < Formula
  desc "Composable build system for OCaml"
  homepage "https://dune.build/"
  url "https://github.com/ocaml/dune/releases/download/3.6.1/dune-3.6.1.tbz"
  sha256 "f1d5ac04b7a027f3d549e25cf885ebf7acc135e0291c18e6b43123a799c143ce"
  license "MIT"
  head "https://github.com/ocaml/dune.git", branch: "main"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_ventura:  "d3b09ec67756894cf1ad0ecc7a280324b5f694e1993eda3fed20c554c16ac558"
    sha256 cellar: :any_skip_relocation, arm64_monterey: "22356cee578225e906d0982b0c04a38bf395c4f5249ac5c0e94a3fb54bd938c2"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "ea8092effe61342886b35d1de52d4e18d4d21ab4bc39328b6da4d75d1081a916"
    sha256 cellar: :any_skip_relocation, ventura:        "84e5412fbff87b7fd0968b80035dfc903f09f771564a2e62b8b1fbe97d703bdd"
    sha256 cellar: :any_skip_relocation, monterey:       "26e36453b741b5c6f5f307cfeb3b8047e4d6afd75a2d5137264896b596257163"
    sha256 cellar: :any_skip_relocation, big_sur:        "c496303691c6dc59a2e335195bb85e13317c06ef3d847ba29763318eb994ef3f"
    sha256 cellar: :any_skip_relocation, catalina:       "27cebca2a88cc76390958a7f55dacb65543b451037312045eed5991f572e3780"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "4aec348495d251736d17ae2cf030cd095b529629e6123c88f713dfaf1f1d8205"
  end

  depends_on "ocaml" => [:build, :test]

  def install
    system "make", "release"
    system "make", "PREFIX=#{prefix}", "install"
    share.install prefix/"man"
    elisp.install Dir[share/"emacs/site-lisp/*"]
  end

  test do
    contents = "bar"
    target_fname = "foo.txt"
    (testpath/"dune").write("(rule (with-stdout-to #{target_fname} (echo #{contents})))")
    system bin/"dune", "build", "foo.txt", "--root", "."
    output = File.read(testpath/"_build/default/#{target_fname}")
    assert_match contents, output
{'fraction_non_alphanumeric': 0.10793131643499591, 'fraction_numerical': 0.21722540201689833, 'mean_word_length': 5.565295169946332, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7437043', 'n_tokens_mistral': 2002, 'n_tokens_neox': 1584, 'n_words': 203}