<commit_before>class Fortio < Formula
  desc "HTTP and gRPC load testing and visualization tool and server"
  homepage "https://fortio.org/"
  url "https://github.com/fortio/fortio.git",
      tag:      "v1.20.0",
      revision: "4a325b93146c7faf5d7ff5a327d3c86abceb141f"
  license "Apache-2.0"

  livecheck do
    url :stable
    regex(/^v?(\d+(?:\.\d+)+)$/i)
  end

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "d3c73210620f0001526a6d0c4306c2d439592de2127f5684690550197f509a24"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "709b73b9f7307818698ba08640f0daba382505614cba9c708a0b47d479520c7a"
    sha256 cellar: :any_skip_relocation, monterey:       "2fc425149da8a4a8c44b0f02657d5007a3d116518824df17e82af7aa4c9a6ef3"
    sha256 cellar: :any_skip_relocation, big_sur:        "28ff0467a06149296a9ed9328eb3df352670102b090111eb9cfc6ab071a02a6d"
    sha256 cellar: :any_skip_relocation, catalina:       "ec25f5d4f26a1d81e4f2d9dd61124790a0f557473863c186c5cb7a9cac23dfcd"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "cf7bd5aa17b8a876c92640eb49a815ab03941f31617addbd4fd8f9c536982c17"
  end

  depends_on "go" => :build

  def install
    system "make", "official-build-clean", "official-build-version", "OFFICIAL_BIN=#{bin}/fortio"
  end

  test do
    assert_match version.to_s, shell_output("#{bin}/fortio version -s")

    port = free_port
    begin
      pid = fork do
        exec bin/"fortio", "server", "-http-port", port.to_s
      end
      sleep 2
      output = shell_output("#{bin}/fortio load http://localhost:#{port}/ 2>&1")<commit_msg>fortio: update 1.20.0 bottle.<commit_after>class Fortio < Formula
  desc "HTTP and gRPC load testing and visualization tool and server"
  homepage "https://fortio.org/"
  url "https://github.com/fortio/fortio.git",
      tag:      "v1.20.0",
      revision: "4a325b93146c7faf5d7ff5a327d3c86abceb141f"
  license "Apache-2.0"

  livecheck do
    url :stable
    regex(/^v?(\d+(?:\.\d+)+)$/i)
  end

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "0c6f9805dbb084f278e3762a280d1f114ce41b083a343cb48a94544b4cfb8197"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "9a17004b44f4413f146fc13c871bcb6b37001289cb97e493f742a2bc2e6c0381"
    sha256 cellar: :any_skip_relocation, monterey:       "9b5fc786958b6fa2059c94a018b265dd0eb26ac9cd475e72e88e3ed2be7fdc39"
    sha256 cellar: :any_skip_relocation, big_sur:        "11c473908185031cbe4e308223a4413dc9bdd2f740713d9d79081e8eb6ceea50"
    sha256 cellar: :any_skip_relocation, catalina:       "2d7d64148bb65a0b2d7dab2d7ae50e7b8dd4c819860db4479926b3a13b7d8b2e"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "e7031a304502832eb784729c62180377035112ef34f7ffd319497e66dae174b3"
  end

  depends_on "go" => :build

  def install
    system "make", "official-build-clean", "official-build-version", "OFFICIAL_BIN=#{bin}/fortio"
  end

  test do
    assert_match version.to_s, shell_output("#{bin}/fortio version -s")

    port = free_port
    begin
      pid = fork do
        exec bin/"fortio", "server", "-http-port", port.to_s
      end
      sleep 2
      output = shell_output("#{bin}/fortio load http://localhost:#{port}/ 2>&1")
{'fraction_non_alphanumeric': 0.10318949343339587, 'fraction_numerical': 0.19637273295809882, 'mean_word_length': 4.4683760683760685, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6464404', 'n_tokens_mistral': 1675, 'n_tokens_neox': 1352, 'n_words': 202}