<commit_before>class GhzWeb < Formula
  desc "Web interface for ghz"
  homepage "https://ghz.sh"
  url "https://github.com/bojand/ghz/archive/v0.52.0.tar.gz"
  sha256 "6f7e4e0cd81ad00c2c4e17c93257810e2ea8897f60713352c9d9583231e2739a"

  depends_on "go" => :build
  depends_on :xcode => :build

  def install
    ENV["CGO_ENABLED"] = "1"
    system "go", "build",
      "-ldflags", "-s -w -X main.version=#{version}",
      *std_go_args,
      "cmd/ghz-web/main.go"
    prefix.install_metafiles
  end

  test do
    assert_match version.to_s, shell_output("#{bin}/ghz-web -v 2>&1")
    port = free_port
    ENV["GHZ_SERVER_PORT"] = port.to_s
    fork do
      exec "#{bin}/ghz-web"
    end<commit_msg>ghz-web: add 0.52.0 bottle.<commit_after>class GhzWeb < Formula
  desc "Web interface for ghz"
  homepage "https://ghz.sh"
  url "https://github.com/bojand/ghz/archive/v0.52.0.tar.gz"
  sha256 "6f7e4e0cd81ad00c2c4e17c93257810e2ea8897f60713352c9d9583231e2739a"

  bottle do
    cellar :any_skip_relocation
    sha256 "1eb234719176dae9c96c548031cf0b9620f64d98468bba2506140257af822b59" => :catalina
    sha256 "2f885d0487a6e27ce932f9020b1d3df50f5ba2ea105402f6539cf94eb225cf81" => :mojave
    sha256 "80931f9681d55d88b0b011077c8d228bcb27497df1e3e080485b969e730b812a" => :high_sierra
  end

  depends_on "go" => :build
  depends_on :xcode => :build

  def install
    ENV["CGO_ENABLED"] = "1"
    system "go", "build",
      "-ldflags", "-s -w -X main.version=#{version}",
      *std_go_args,
      "cmd/ghz-web/main.go"
    prefix.install_metafiles
  end

  test do
    assert_match version.to_s, shell_output("#{bin}/ghz-web -v 2>&1")
    port = free_port
    ENV["GHZ_SERVER_PORT"] = port.to_s
    fork do
      exec "#{bin}/ghz-web"
    end
{'fraction_non_alphanumeric': 0.12938470385278897, 'fraction_numerical': 0.1472110408280621, 'mean_word_length': 3.627659574468085, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '4395046', 'n_tokens_mistral': 891, 'n_tokens_neox': 761, 'n_words': 120}