<commit_before>class Rbspy < Formula
  desc "Sampling profiler for Ruby"
  homepage "https://rbspy.github.io/"
  url "https://github.com/rbspy/rbspy/archive/v0.4.0.tar.gz"
  sha256 "3e5b808e0858707a4f8d06c98c0c6112ccf2d3cb7106bce5b51484c22e81d87a"
  license "MIT"

  bottle do
    sha256 cellar: :any_skip_relocation, big_sur:  "4baf01d5246bc1bbddd9f8854c1c104c3351c6615fca4cd330fe82f37e86b412"
    sha256 cellar: :any_skip_relocation, catalina: "96201481303eccc9cee8714115590fb6db6f465b7f87f7e5a28e3f691dfdaeb4"
    sha256 cellar: :any_skip_relocation, mojave:   "0a9a0b5f06b56374fbd318006e74634bc19a25af7a621cfc452e201ff78fd82b"
  end

  depends_on "rust" => :build

  def install
    system "cargo", "install", *std_cargo_args
  end

  test do
    recording = <<~EOS
      H4sICCOlhlsAA2JyZXdfdGVzdF9yZXN1bHQAvdHBCsIwDAbgu08hOQ/nHKgM8S08iYy0Vlds0
      5J2Dhl7d3eZTNxN8Rb4yf9BwiL4xzKbtRAZpYLi2AKh7QfYyfmlJhm1oz0kwMpg1HdVeoxVH9
      d0I9dQn6AIztRxSKg2JgGjSZGDYtklr0ZEnCgKleNYenZXRrtg8dkI6SEoDmnlrEoFqyYNaL1
      R70uDuBqJQogpcWL7K3I9IqWU/yCz8WF3FvXkk37P5t0pAa/PUOTbfLvpZk/I+tcWQgIAAA==
    EOS

    (testpath/"recording.gz").write Base64.decode64(recording.delete("\n"))
    system "#{bin}/rbspy", "report", "-f", "summary", "-i", "recording.gz",
                           "-o", "result"

    expected_result = "100.00   100.00  aaa - short_program.rb"
    assert_includes File.read("result"), expected_result
  end
end
<commit_msg>rbspy 0.4.2<commit_after>class Rbspy < Formula
  desc "Sampling profiler for Ruby"
  homepage "https://rbspy.github.io/"
  url "https://github.com/rbspy/rbspy/archive/v0.4.2.tar.gz"
  sha256 "4bd76a63db015401124031929ea7138a2625cb6da6300df45dea491e96046cdc"
  license "MIT"

  bottle do
    sha256 cellar: :any_skip_relocation, big_sur:  "4baf01d5246bc1bbddd9f8854c1c104c3351c6615fca4cd330fe82f37e86b412"
    sha256 cellar: :any_skip_relocation, catalina: "96201481303eccc9cee8714115590fb6db6f465b7f87f7e5a28e3f691dfdaeb4"
    sha256 cellar: :any_skip_relocation, mojave:   "0a9a0b5f06b56374fbd318006e74634bc19a25af7a621cfc452e201ff78fd82b"
  end

  depends_on "rust" => :build

  def install
    system "cargo", "install", *std_cargo_args
  end

  test do
    recording = <<~EOS
      H4sICCOlhlsAA2JyZXdfdGVzdF9yZXN1bHQAvdHBCsIwDAbgu08hOQ/nHKgM8S08iYy0Vlds0
      5J2Dhl7d3eZTNxN8Rb4yf9BwiL4xzKbtRAZpYLi2AKh7QfYyfmlJhm1oz0kwMpg1HdVeoxVH9
      d0I9dQn6AIztRxSKg2JgGjSZGDYtklr0ZEnCgKleNYenZXRrtg8dkI6SEoDmnlrEoFqyYNaL1
      R70uDuBqJQogpcWL7K3I9IqWU/yCz8WF3FvXkk37P5t0pAa/PUOTbfLvpZk/I+tcWQgIAAA==
    EOS

    (testpath/"recording.gz").write Base64.decode64(recording.delete("\n"))
    system "#{bin}/rbspy", "report", "-f", "summary", "-i", "recording.gz",
                           "-o", "result"

    expected_result = "100.00   100.00  aaa - short_program.rb"
    assert_includes File.read("result"), expected_result
  end
end

{'fraction_non_alphanumeric': 0.09331476323119778, 'fraction_numerical': 0.16260445682451252, 'mean_word_length': 4.887295081967213, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '5126636', 'n_tokens_mistral': 1636, 'n_tokens_neox': 1408, 'n_words': 149}