<commit_before>require "language/node"

class Apidoc < Formula
  desc "RESTful web API Documentation Generator"
  homepage "https://apidocjs.com"
  url "https://github.com/apidoc/apidoc/archive/0.50.0.tar.gz"
  sha256 "4705ba8a68df2b2285b008f19c7a724297640ad112d181625f791af87024926b"
  license "MIT"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "69d9f81dc0cf0416ae6fef93b09ccb994e57d47046dd6c21eb610daae87ca1fe"
    sha256 cellar: :any_skip_relocation, big_sur:       "209889e11d2641e73152d2c67acae004e396ad1047c2c16ab751ba709ef460ca"
    sha256 cellar: :any_skip_relocation, catalina:      "209889e11d2641e73152d2c67acae004e396ad1047c2c16ab751ba709ef460ca"
    sha256 cellar: :any_skip_relocation, mojave:        "209889e11d2641e73152d2c67acae004e396ad1047c2c16ab751ba709ef460ca"
    sha256 cellar: :any_skip_relocation, x86_64_linux:  "55e98638e7ac48270c94b3e5bd063b83007ab8f51c8533a03c59fcd52fd21e19"
  end

  depends_on "node"

  on_macos do
    depends_on "macos-term-size"
  end

  def install
    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
    bin.install_symlink Dir["#{libexec}/bin/*"]

    # Extract native slices from universal binaries
    deuniversalize_machos
  end

  test do
    (testpath/"api.go").write <<~EOS
      /**<commit_msg>apidoc: update 0.50.0 bottle.<commit_after>require "language/node"

class Apidoc < Formula
  desc "RESTful web API Documentation Generator"
  homepage "https://apidocjs.com"
  url "https://github.com/apidoc/apidoc/archive/0.50.0.tar.gz"
  sha256 "4705ba8a68df2b2285b008f19c7a724297640ad112d181625f791af87024926b"
  license "MIT"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "5038d62fe32f3617495a701e756b1fc272574dedcf6ea0cb90c4ee6c6b991d3d"
    sha256 cellar: :any_skip_relocation, big_sur:       "5a9e988f0c0a8f4889c4ca69fc0078c206d6a2de487e422401d96913139cfb85"
    sha256 cellar: :any_skip_relocation, catalina:      "5a9e988f0c0a8f4889c4ca69fc0078c206d6a2de487e422401d96913139cfb85"
    sha256 cellar: :any_skip_relocation, mojave:        "5a9e988f0c0a8f4889c4ca69fc0078c206d6a2de487e422401d96913139cfb85"
    sha256 cellar: :any_skip_relocation, x86_64_linux:  "4faeb7dc6fdeaac856167dcd0f56425d7a4d472a1c6ea06845292166f1a5f02c"
  end

  depends_on "node"

  on_macos do
    depends_on "macos-term-size"
  end

  def install
    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
    bin.install_symlink Dir["#{libexec}/bin/*"]

    # Extract native slices from universal binaries
    deuniversalize_machos
  end

  test do
    (testpath/"api.go").write <<~EOS
      /**
{'fraction_non_alphanumeric': 0.08244274809160305, 'fraction_numerical': 0.21412213740458017, 'mean_word_length': 5.346246973365617, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '1499238', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1113, 'n_words': 151}