<commit_before>class Cdiff < Formula
  desc "View colored diff with side by side and auto pager support"
  homepage "https://github.com/ymattw/cdiff"
  url "https://github.com/ymattw/cdiff/archive/1.0.tar.gz"
  sha256 "d9aa95299973cf25cba9d62a41df845ec4c5d391b9aca4d84f32fcefecccd846"
  head "https://github.com/ymattw/cdiff.git"

  bottle :unneeded

  depends_on "python@2" if MacOS.version <= :snow_leopard

  conflicts_with "colordiff", :because => "both install `cdiff` binaries"

  def install
    ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
    system "python", *Language::Python.setup_install_args(libexec)
    bin.install Dir[libexec/"bin/*"]
    bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
  end

  test do
    diff_fixture = test_fixtures("test.diff").read
    assert_equal diff_fixture,
      pipe_output("#{bin}/cdiff -cnever", diff_fixture)
  end
end<commit_msg>cdiff: depend on python@2<commit_after>class Cdiff < Formula
  desc "View colored diff with side by side and auto pager support"
  homepage "https://github.com/ymattw/cdiff"
  url "https://github.com/ymattw/cdiff/archive/1.0.tar.gz"
  sha256 "d9aa95299973cf25cba9d62a41df845ec4c5d391b9aca4d84f32fcefecccd846"
  head "https://github.com/ymattw/cdiff.git"

  bottle :unneeded

  depends_on "python@2"

  conflicts_with "colordiff", :because => "both install `cdiff` binaries"

  def install
    ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
    system "python", *Language::Python.setup_install_args(libexec)
    bin.install Dir[libexec/"bin/*"]
    bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
  end

  test do
    diff_fixture = test_fixtures("test.diff").read
    assert_equal diff_fixture,
      pipe_output("#{bin}/cdiff -cnever", diff_fixture)
  end
end
{'fraction_non_alphanumeric': 0.12419006479481641, 'fraction_numerical': 0.044816414686825054, 'mean_word_length': 4.701538461538462, 'pattern_counts': {'":': 0, '<': 6, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '715295', 'n_tokens_mistral': 739, 'n_tokens_neox': 693, 'n_words': 123}