<commit_before>class Kcgi < Formula
  desc "Minimal CGI and FastCGI library for C/C++"
  homepage "https://kristaps.bsd.lv/kcgi"
  url "https://kristaps.bsd.lv/kcgi/snapshots/kcgi-0.12.4.tgz"
  sha256 "e9950cda9a118a778b79bcde5a5d585a78dec4cb259731e6d9e866bcae8f3346"
  license "ISC"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "cf19665f8b909fc185747aeda39a2eccb74cbd5159cd8b16a4d170055001ffce"
    sha256 cellar: :any_skip_relocation, big_sur:       "ffce6f2eb26e7855808b3528077921b371cbded63bc54ba4f640d90ff766d888"
    sha256 cellar: :any_skip_relocation, catalina:      "b215aed52ae23d42a8cb74d75195443cfff9666503863403f910b5be9fe844e3"
    sha256 cellar: :any_skip_relocation, mojave:        "ba732464c3b7a7e1c511ee93b4b03460df9979a72846511962385cc642af36fb"
  end

  depends_on "bmake" => :build

  def install
    system "./configure", "MANDIR=#{man}",
                          "PREFIX=#{prefix}"
    system "bmake"
    system "bmake", "install"
  end

  test do
    (testpath/"test.c").write <<~EOS
      #include <sys/types.h><commit_msg>kcgi 0.12.5<commit_after>class Kcgi < Formula
  desc "Minimal CGI and FastCGI library for C/C++"
  homepage "https://kristaps.bsd.lv/kcgi"
  url "https://kristaps.bsd.lv/kcgi/snapshots/kcgi-0.12.5.tgz"
  sha256 "06ed033de3723651d76e2fac1c2442aaa3a28ac231cbfda4142dfb8782cab363"
  license "ISC"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "cf19665f8b909fc185747aeda39a2eccb74cbd5159cd8b16a4d170055001ffce"
    sha256 cellar: :any_skip_relocation, big_sur:       "ffce6f2eb26e7855808b3528077921b371cbded63bc54ba4f640d90ff766d888"
    sha256 cellar: :any_skip_relocation, catalina:      "b215aed52ae23d42a8cb74d75195443cfff9666503863403f910b5be9fe844e3"
    sha256 cellar: :any_skip_relocation, mojave:        "ba732464c3b7a7e1c511ee93b4b03460df9979a72846511962385cc642af36fb"
  end

  depends_on "bmake" => :build

  def install
    system "./configure", "MANDIR=#{man}",
                          "PREFIX=#{prefix}"
    system "bmake"
    system "bmake", "install"
  end

  test do
    (testpath/"test.c").write <<~EOS
      #include <sys/types.h>
{'fraction_non_alphanumeric': 0.09794776119402986, 'fraction_numerical': 0.2080223880597015, 'mean_word_length': 4.416666666666667, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '296236', 'n_tokens_mistral': 1165, 'n_tokens_neox': 916, 'n_words': 126}