<commit_before>class CheckPostgres < Formula
  desc "Monitor Postgres databases"
  homepage "https://bucardo.org/wiki/Check_postgres"
  url "https://bucardo.org/downloads/check_postgres-2.25.0.tar.gz"
  sha256 "11b52f86c44d6cc26e9a4129e67c2589071dbe1b8ac1f8895761517491c6e44b"
  license "BSD-2-Clause"
  revision 1
  head "https://github.com/bucardo/check_postgres.git", branch: "master"

  livecheck do
    url "https://bucardo.org/check_postgres/"
    regex(/latest version.*?v?(\d+(?:\.\d+)+)/i)
  end

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "22d46f4b0bbeb45eb82aa190e08f5fcbbbd2ae67dd2cf019f55d126896df4b14"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "1b4c6b85f790396a5c498e7354b548e981fcdc84d9c0fef2cfee0cbf6a8111de"
    sha256 cellar: :any_skip_relocation, monterey:       "5508d21411c621740b4f1029eb82143b24f0ce7fa72b32cf74b2e02417e0d4a6"
    sha256 cellar: :any_skip_relocation, big_sur:        "4d3fab04056d9f73cbbf1687301e43993c696637d86146d4124b74a0222d321f"
    sha256 cellar: :any_skip_relocation, catalina:       "6a52850ba011c00b1daf005009ef0143d02d397cd2b212f69ffcc92f9c93e7a5"
    sha256 cellar: :any_skip_relocation, mojave:         "09f45361f23beae689194d98e4a8d4788e38d8a57f8be94c6fb5bcc5a7dd8950"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "d8213c30652e0d80ba84867c9b8db6924801a43c7b0df1273c20cafbd6ee4160"
  end

  depends_on "postgresql"

  def install
    system "perl", "Makefile.PL", "INSTALL_BASE=#{prefix}", "INSTALLSITEMAN1DIR=#{man1}"
    system "make", "install"
    mv bin/"check_postgres.pl", bin/"check_postgres"
    inreplace [bin/"check_postgres", man1/"check_postgres.1p"], "check_postgres.pl", "check_postgres"
    rm_rf prefix/"Library"
    rm_rf prefix/"lib"
  end

  test do
    # This test verifies that check_postgres fails correctly, assuming
    # that no server is running at that port.
    output = shell_output("#{bin}/check_postgres --action=connection --port=65432", 2)
    assert_match "POSTGRES_CONNECTION CRITICAL", output
  end
end
<commit_msg>check_postgres: revision bump for libpq<commit_after>class CheckPostgres < Formula
  desc "Monitor Postgres databases"
  homepage "https://bucardo.org/wiki/Check_postgres"
  url "https://bucardo.org/downloads/check_postgres-2.25.0.tar.gz"
  sha256 "11b52f86c44d6cc26e9a4129e67c2589071dbe1b8ac1f8895761517491c6e44b"
  license "BSD-2-Clause"
  revision 2
  head "https://github.com/bucardo/check_postgres.git", branch: "master"

  livecheck do
    url "https://bucardo.org/check_postgres/"
    regex(/latest version.*?v?(\d+(?:\.\d+)+)/i)
  end

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "22d46f4b0bbeb45eb82aa190e08f5fcbbbd2ae67dd2cf019f55d126896df4b14"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "1b4c6b85f790396a5c498e7354b548e981fcdc84d9c0fef2cfee0cbf6a8111de"
    sha256 cellar: :any_skip_relocation, monterey:       "5508d21411c621740b4f1029eb82143b24f0ce7fa72b32cf74b2e02417e0d4a6"
    sha256 cellar: :any_skip_relocation, big_sur:        "4d3fab04056d9f73cbbf1687301e43993c696637d86146d4124b74a0222d321f"
    sha256 cellar: :any_skip_relocation, catalina:       "6a52850ba011c00b1daf005009ef0143d02d397cd2b212f69ffcc92f9c93e7a5"
    sha256 cellar: :any_skip_relocation, mojave:         "09f45361f23beae689194d98e4a8d4788e38d8a57f8be94c6fb5bcc5a7dd8950"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "d8213c30652e0d80ba84867c9b8db6924801a43c7b0df1273c20cafbd6ee4160"
  end

  depends_on "libpq"
  uses_from_macos "perl"

  def install
    system "perl", "Makefile.PL", "INSTALL_BASE=#{prefix}", "INSTALLSITEMAN1DIR=#{man1}"
    system "make", "install"

    mkdir_p libexec/"bin"
    mv bin/"check_postgres.pl", libexec/"bin/check_postgres.pl"
    inreplace [libexec/"bin/check_postgres.pl", man1/"check_postgres.1p"], "check_postgres.pl", "check_postgres"

    (bin/"check_postgres").write_env_script libexec/"bin/check_postgres.pl", PATH: "#{Formula["libpq"].opt_bin}:$PATH"

    rm_rf prefix/"Library"
    rm_rf prefix/"lib"
  end

  test do
    # This test verifies that check_postgres fails correctly, assuming
    # that no server is running at that port.
    output = shell_output("#{bin}/check_postgres --action=connection --port=65432", 2)
    assert_match "POSTGRES_CONNECTION CRITICAL", output
  end
end

{'fraction_non_alphanumeric': 0.09958410351201478, 'fraction_numerical': 0.17190388170055454, 'mean_word_length': 5.432392273402675, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 8, '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': '4479014', 'n_tokens_mistral': 2199, 'n_tokens_neox': 1811, 'n_words': 252}