<commit_before>require "language/node"

class OpensearchDashboards < Formula
  desc "Open source visualization dashboards for OpenSearch"
  homepage "https://opensearch.org/docs/dashboards/index/"
  url "https://github.com/opensearch-project/OpenSearch-Dashboards.git",
      tag:      "2.3.0",
      revision: "5f7541eaa91699b9de9d82e5636d1e6abaa8f414"
  license "Apache-2.0"
  revision 1

  bottle do
    sha256 cellar: :any_skip_relocation, ventura:      "1c36f9b8ccb0208c4fb3985d5e69500ad1ea2dcbc370421a4d7db90f47be6e36"
    sha256 cellar: :any_skip_relocation, monterey:     "9ace1278a473cc0be04e9ac94d3bd4567e1e296441b86b0869e63074b7840351"
    sha256 cellar: :any_skip_relocation, big_sur:      "9ace1278a473cc0be04e9ac94d3bd4567e1e296441b86b0869e63074b7840351"
    sha256 cellar: :any_skip_relocation, catalina:     "9ace1278a473cc0be04e9ac94d3bd4567e1e296441b86b0869e63074b7840351"
    sha256 cellar: :any_skip_relocation, x86_64_linux: "4ca1ba8aabd0c6fa3d82e7277d957ab493c2bf2bb2dda5636159ddf0f3486bb4"
  end

  depends_on "yarn" => :build
  depends_on arch: :x86_64 # https://github.com/opensearch-project/OpenSearch-Dashboards/issues/1630
  depends_on "node@14" # use `node@16` after https://github.com/opensearch-project/OpenSearch-Dashboards/issues/406

  def install
    inreplace "package.json", /"node": "14\.\d+\.\d+"/, %Q("node": "#{Formula["node@14"].version}")

    # Do not download node and discard all actions related to this node
    inreplace "src/dev/build/build_distributables.ts" do |s|
      s.gsub! "await run(options.downloadFreshNode ? Tasks.DownloadNodeBuilds : Tasks.VerifyExistingNodeBuilds);", ""<commit_msg>opensearch-dashboards 2.4.0<commit_after>require "language/node"

class OpensearchDashboards < Formula
  desc "Open source visualization dashboards for OpenSearch"
  homepage "https://opensearch.org/docs/dashboards/index/"
  url "https://github.com/opensearch-project/OpenSearch-Dashboards.git",
      tag:      "2.4.0",
      revision: "6e38e1c6f71e56b70f9b89a0452c19f3667995e8"
  license "Apache-2.0"

  bottle do
    sha256 cellar: :any_skip_relocation, ventura:      "1c36f9b8ccb0208c4fb3985d5e69500ad1ea2dcbc370421a4d7db90f47be6e36"
    sha256 cellar: :any_skip_relocation, monterey:     "9ace1278a473cc0be04e9ac94d3bd4567e1e296441b86b0869e63074b7840351"
    sha256 cellar: :any_skip_relocation, big_sur:      "9ace1278a473cc0be04e9ac94d3bd4567e1e296441b86b0869e63074b7840351"
    sha256 cellar: :any_skip_relocation, catalina:     "9ace1278a473cc0be04e9ac94d3bd4567e1e296441b86b0869e63074b7840351"
    sha256 cellar: :any_skip_relocation, x86_64_linux: "4ca1ba8aabd0c6fa3d82e7277d957ab493c2bf2bb2dda5636159ddf0f3486bb4"
  end

  depends_on "yarn" => :build
  depends_on arch: :x86_64 # https://github.com/opensearch-project/OpenSearch-Dashboards/issues/1630
  depends_on "node@14" # use `node@16` after https://github.com/opensearch-project/OpenSearch-Dashboards/issues/406

  def install
    inreplace "package.json", /"node": "14\.\d+\.\d+"/, %Q("node": "#{Formula["node@14"].version}")

    # Do not download node and discard all actions related to this node
    inreplace "src/dev/build/build_distributables.ts" do |s|
      s.gsub! "await run(options.downloadFreshNode ? Tasks.DownloadNodeBuilds : Tasks.VerifyExistingNodeBuilds);", ""
{'fraction_non_alphanumeric': 0.10422364023093285, 'fraction_numerical': 0.16651473716195686, 'mean_word_length': 5.392233009708738, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4309996', 'n_tokens_mistral': 1591, 'n_tokens_neox': 1338, 'n_words': 187}