<commit_before>class Reposurgeon < Formula
  desc "Edit version-control repository history"
  homepage "http://www.catb.org/esr/reposurgeon/"
  url "https://gitlab.com/esr/reposurgeon.git",
      :tag      => "3.46",
      :revision => "0966b8347055ab604c823f0c483c2952564e0c09"
  head "https://gitlab.com/esr/reposurgeon.git"

  bottle do
    cellar :any_skip_relocation
    sha256 "78c5b14781272ab3bb7faf43cb1229e99ce09589dba6d0e0c2baff4a8fa8b60a" => :mojave
    sha256 "3acbcc4e23c832fcbe70030a682956fbd36d42898b8f0afc02cf2bdc9334b14e" => :high_sierra
    sha256 "c4c3cbaa9428773df404fb1676a23d152b24f012b6508c4aac4f9475ff787aa9" => :sierra
  end

  depends_on "asciidoc" => :build
  depends_on "go" => :build
  depends_on "xmlto" => :build
  depends_on "pypy"

  def install
    ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
    system "make", "install", "prefix=#{prefix}"
    elisp.install "reposurgeon-mode.el"
  end

  test do
    (testpath/".gitconfig").write <<~EOS
      [user]
        name = <NAME>
        email = <EMAIL>
    EOS
    system "git", "init"
    system "git", "commit", "--allow-empty", "--message", "brewing"

    assert_match "brewing",<commit_msg>reposurgeon 3.47<commit_after>class Reposurgeon < Formula
  desc "Edit version-control repository history"
  homepage "http://www.catb.org/esr/reposurgeon/"
  url "https://gitlab.com/esr/reposurgeon.git",
      :tag      => "3.47",
      :revision => "a98846488b2df75f39de3180085ef9e49603815c"
  head "https://gitlab.com/esr/reposurgeon.git"

  bottle do
    cellar :any_skip_relocation
    sha256 "78c5b14781272ab3bb7faf43cb1229e99ce09589dba6d0e0c2baff4a8fa8b60a" => :mojave
    sha256 "3acbcc4e23c832fcbe70030a682956fbd36d42898b8f0afc02cf2bdc9334b14e" => :high_sierra
    sha256 "c4c3cbaa9428773df404fb1676a23d152b24f012b6508c4aac4f9475ff787aa9" => :sierra
  end

  depends_on "asciidoc" => :build
  depends_on "go" => :build
  depends_on "xmlto" => :build
  depends_on "pypy"

  def install
    ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
    system "make", "install", "prefix=#{prefix}"
    elisp.install "reposurgeon-mode.el"
  end

  test do
    (testpath/".gitconfig").write <<~EOS
      [user]
        name = <NAME>
        email = <EMAIL>
    EOS
    system "git", "init"
    system "git", "commit", "--allow-empty", "--message", "brewing"

    assert_match "brewing",
{'fraction_non_alphanumeric': 0.13183552352691819, 'fraction_numerical': 0.13098770665536244, 'mean_word_length': 3.9269311064718164, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 23, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, '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': '6501251', 'n_tokens_mistral': 1147, 'n_tokens_neox': 989, 'n_words': 150}