<commit_before>class Tailscale < Formula
  desc "Easiest, most secure way to use WireGuard and 2FA"
  homepage "https://tailscale.com"
  url "https://github.com/tailscale/tailscale.git",
      tag:      "v1.30.0",
      revision: "0b00b7a135b635fadd8a9a38567562798873ab82"
  license "BSD-3-Clause"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "f6331bff437dcd5b3755d1461def9204f7c45edf14bb155c5a8170d4a9932aa0"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "b3957d5624e89e45840f996c6b922b15423ce64e10d17e37283b80db5479d335"
    sha256 cellar: :any_skip_relocation, monterey:       "f283a3b9c52d535217be4b73bbb5a2e1fa5e3415a53a7d1c4b6a5967b0b0002a"
    sha256 cellar: :any_skip_relocation, big_sur:        "5f92a30787902846adfb6101c379c011b50e96045f1591d29da590038ee77eda"
    sha256 cellar: :any_skip_relocation, catalina:       "233478785e4e11dbe4af14040aa875489439d3630f1bf9fd54c7b26475e9c296"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "9110cd462341af55ec8bd27987fa23d9240d1c57bae86cd7e917a26424baa1f6"
  end

  depends_on "go" => :build

  def install
    vars = Utils.safe_popen_read("./build_dist.sh", "shellvars")
    ldflags = %W[
      -s -w
      -X tailscale.com/version.Long=#{vars.match(/VERSION_LONG="(.*)"/)[1]}
      -X tailscale.com/version.Short=#{vars.match(/VERSION_SHORT="(.*)"/)[1]}
      -X tailscale.com/version.GitCommit=#{vars.match(/VERSION_GIT_HASH="(.*)-dirty"/)[1]}
    ].join(" ")
    system "go", "build", *std_go_args(ldflags: ldflags), "tailscale.com/cmd/tailscale"
    system "go", "build", *std_go_args(ldflags: ldflags), "-o", bin/"tailscaled", "tailscale.com/cmd/tailscaled"
  end

  service do
    run opt_bin/"tailscaled"
    keep_alive true
    log_path var/"log/tailscaled.log"
    error_log_path var/"log/tailscaled.log"
  end

  test do
    version_text = shell_output("#{bin}/tailscale version")
    assert_match version.to_s, version_text
    assert_match(/commit: [a-f0-9]{40}/, version_text)
<commit_msg>tailscale: update 1.30.0 bottle.<commit_after>class Tailscale < Formula
  desc "Easiest, most secure way to use WireGuard and 2FA"
  homepage "https://tailscale.com"
  url "https://github.com/tailscale/tailscale.git",
      tag:      "v1.30.0",
      revision: "0b00b7a135b635fadd8a9a38567562798873ab82"
  license "BSD-3-Clause"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "0f32a25536390eb7c5358d4fffd1c238f5dac26e334374bf3a4c10443347f736"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "1cfb27f8fde7f92ef557ddf42325bf0561e2cd3bd95e7e09fbff43f79cd7c42f"
    sha256 cellar: :any_skip_relocation, monterey:       "ad96de60b24a239a44c7a0b7bcbc7f9155ea62fb11b966bd5667f66c49bd7adc"
    sha256 cellar: :any_skip_relocation, big_sur:        "502192ec47c46ea60c4a3bc67e16e5593bb215074a3b57ac07dd8b9bff0a139b"
    sha256 cellar: :any_skip_relocation, catalina:       "d4b1e1d63ae1e25dfd0034e781a5b0d8a8621be165fa4a9d9fb7724a4317fb69"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "087c07aa89d55808098d1d83ed1d96a24861492bc42a87116bfc16cd30bd8e4b"
  end

  depends_on "go" => :build

  def install
    vars = Utils.safe_popen_read("./build_dist.sh", "shellvars")
    ldflags = %W[
      -s -w
      -X tailscale.com/version.Long=#{vars.match(/VERSION_LONG="(.*)"/)[1]}
      -X tailscale.com/version.Short=#{vars.match(/VERSION_SHORT="(.*)"/)[1]}
      -X tailscale.com/version.GitCommit=#{vars.match(/VERSION_GIT_HASH="(.*)-dirty"/)[1]}
    ].join(" ")
    system "go", "build", *std_go_args(ldflags: ldflags), "tailscale.com/cmd/tailscale"
    system "go", "build", *std_go_args(ldflags: ldflags), "-o", bin/"tailscaled", "tailscale.com/cmd/tailscaled"
  end

  service do
    run opt_bin/"tailscaled"
    keep_alive true
    log_path var/"log/tailscaled.log"
    error_log_path var/"log/tailscaled.log"
  end

  test do
    version_text = shell_output("#{bin}/tailscale version")
    assert_match version.to_s, version_text
    assert_match(/commit: [a-f0-9]{40}/, version_text)

{'fraction_non_alphanumeric': 0.12186023377269337, 'fraction_numerical': 0.15493658293956727, 'mean_word_length': 4.721194879089616, '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': 1}}
{'dir': 'git-commits-cleaned', 'id': '6773116', 'n_tokens_mistral': 2021, 'n_tokens_neox': 1689, 'n_words': 227}