<commit_before>class Ehco < Formula
  desc "Network relay tool and a typo :)"
  homepage "https://github.com/Ehco1996/ehco"
  url "https://github.com/Ehco1996/ehco/archive/refs/tags/v1.0.6.tar.gz"
  sha256 "326c468c3790ad01031e52ccb4efcfa5e331d2198fdb13137749c67e8eaacf38"
  license "GPL-3.0-only"

  livecheck do
    url :stable
    regex(/^v?(\d+(?:\.\d+){1,2})$/i)
  end

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "f5bb2716a01d4cede9dfdf1bdcf6f1170ac5ada0647cf55ac13d313e4af61489"
    sha256 cellar: :any_skip_relocation, big_sur:       "0735f491493dc56c2655dba4c1cdbe585860bd3e9cd934c00341cce9d836352a"
    sha256 cellar: :any_skip_relocation, catalina:      "1010c92ff010f913a575284a644707b835bf842dedf4850132ee161dd52ec0e1"
    sha256 cellar: :any_skip_relocation, mojave:        "de0558b7bc58fd084626cb1423c90a3fc74ab4f803b3db9142b8fa36cd713c9a"
  end

  depends_on "go" => :build

  def install
    system "go", "build", *std_go_args, "cmd/ehco/main.go"
  end

  test do
    version_info = shell_output("#{bin}/ehco -v")
    assert_match "ehco version #{version}", version_info

    # run nc server
    nc_port = free_port
    nc_pid = spawn "nc", "-l", "-p", nc_port.to_s
    sleep 1

    # run ehco server
    listen_port = free_port
    ehco_pid = spawn bin/"ehco", "-l", "localhost:#{listen_port}", "-r", "localhost:#{nc_port}", "-web_port", nil.to_s
    sleep 1

    system "nc", "-z", "localhost", listen_port.to_s
  ensure
    Process.kill("HUP", ehco_pid)
    Process.kill("HUP", nc_pid)
  end
end<commit_msg>ehco 1.0.7<commit_after>class Ehco < Formula
  desc "Network relay tool and a typo :)"
  homepage "https://github.com/Ehco1996/ehco"
  url "https://github.com/Ehco1996/ehco/archive/refs/tags/v1.0.7.tar.gz"
  sha256 "d6384cdb31befcf9a198dd1be6c0073e9fabb6823f2f92df63bb50fb14ec6ff1"
  license "GPL-3.0-only"

  livecheck do
    url :stable
    regex(/^v?(\d+(?:\.\d+){1,2})$/i)
  end

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "f5bb2716a01d4cede9dfdf1bdcf6f1170ac5ada0647cf55ac13d313e4af61489"
    sha256 cellar: :any_skip_relocation, big_sur:       "0735f491493dc56c2655dba4c1cdbe585860bd3e9cd934c00341cce9d836352a"
    sha256 cellar: :any_skip_relocation, catalina:      "1010c92ff010f913a575284a644707b835bf842dedf4850132ee161dd52ec0e1"
    sha256 cellar: :any_skip_relocation, mojave:        "de0558b7bc58fd084626cb1423c90a3fc74ab4f803b3db9142b8fa36cd713c9a"
  end

  depends_on "go" => :build

  def install
    system "go", "build", *std_go_args, "cmd/ehco/main.go"
  end

  test do
    version_info = shell_output("#{bin}/ehco -v")
    assert_match "ehco version #{version}", version_info

    # run nc server
    nc_port = free_port
    nc_pid = spawn "nc", "-l", nc_port.to_s
    sleep 1

    # run ehco server
    listen_port = free_port
    ehco_pid = spawn bin/"ehco", "-l", "localhost:#{listen_port}", "-r", "localhost:#{nc_port}"
    sleep 1

    system "nc", "-z", "localhost", listen_port.to_s
  ensure
    Process.kill("HUP", ehco_pid)
    Process.kill("HUP", nc_pid)
  end
end
{'fraction_non_alphanumeric': 0.12247557003257328, 'fraction_numerical': 0.14788273615635178, 'mean_word_length': 4.17003367003367, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3775393', 'n_tokens_mistral': 1562, 'n_tokens_neox': 1307, 'n_words': 215}