<commit_before>class Kamel < Formula
  desc "Apache Camel K CLI"
  homepage "https://camel.apache.org/"
  url "https://github.com/apache/camel-k.git",
      tag:      "v1.3.2",
      revision: "619900dda959838499eb5ea6949e1e008b44a8bf"
  license "Apache-2.0"
  head "https://github.com/apache/camel-k.git"

  livecheck do
    url :stable
    strategy :github_latest
  end

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "65348d15b231c7d414f08656de6e057c69249404fbd94d76a5526a05e2efa20d"
    sha256 cellar: :any_skip_relocation, big_sur:       "e70071d20d4463314430567ea64c43c32dd0394cf88e7756fd7f6019ab776fab"
    sha256 cellar: :any_skip_relocation, catalina:      "d694f515c43e1339a756a492479f403a087954a5d6f424517ea50869003a474a"
    sha256 cellar: :any_skip_relocation, mojave:        "eaaa8a6eadf177b576260eb7ce5ffa95b0cd858890b14fa8f73d07368f27d6ed"
  end

  depends_on "go" => :build
  depends_on "openjdk@11" => :build

  def install
    ENV["JAVA_HOME"] = Language::Java.java_home("11")
    system "make"
    bin.install "kamel"

    output = Utils.safe_popen_read("#{bin}/kamel", "completion", "bash")
    (bash_completion/"kamel").write output

    output = Utils.safe_popen_read("#{bin}/kamel", "completion", "zsh")
    (zsh_completion/"_kamel").write output
  end

  test do
    run_output = shell_output("#{bin}/kamel 2>&1")
    assert_match "Apache Camel K is a lightweight", run_output

    help_output = shell_output("echo $(#{bin}/kamel help 2>&1)")
    assert_match "Error: cannot get command client: invalid configuration", help_output.chomp

    get_output = shell_output("echo $(#{bin}/kamel get 2>&1)")
    assert_match "Error: cannot get command client: invalid configuration", get_output

    version_output = shell_output("echo $(#{bin}/kamel version 2>&1)")
    assert_match version.to_s, version_output<commit_msg>kamel 1.4.0<commit_after>class Kamel < Formula
  desc "Apache Camel K CLI"
  homepage "https://camel.apache.org/"
  url "https://github.com/apache/camel-k.git",
      tag:      "v1.4.0",
      revision: "4e7c313e87f7f808dcf5cd3182dcacf8874618bc"
  license "Apache-2.0"
  head "https://github.com/apache/camel-k.git"

  livecheck do
    url :stable
    strategy :github_latest
  end

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "65348d15b231c7d414f08656de6e057c69249404fbd94d76a5526a05e2efa20d"
    sha256 cellar: :any_skip_relocation, big_sur:       "e70071d20d4463314430567ea64c43c32dd0394cf88e7756fd7f6019ab776fab"
    sha256 cellar: :any_skip_relocation, catalina:      "d694f515c43e1339a756a492479f403a087954a5d6f424517ea50869003a474a"
    sha256 cellar: :any_skip_relocation, mojave:        "eaaa8a6eadf177b576260eb7ce5ffa95b0cd858890b14fa8f73d07368f27d6ed"
  end

  depends_on "go" => :build
  depends_on "openjdk@11" => :build

  def install
    ENV["JAVA_HOME"] = Language::Java.java_home("11")
    system "make"
    bin.install "kamel"

    output = Utils.safe_popen_read("#{bin}/kamel", "completion", "bash")
    (bash_completion/"kamel").write output

    output = Utils.safe_popen_read("#{bin}/kamel", "completion", "zsh")
    (zsh_completion/"_kamel").write output
  end

  test do
    run_output = shell_output("#{bin}/kamel 2>&1")
    assert_match "Apache Camel K is a lightweight", run_output

    help_output = shell_output("echo $(#{bin}/kamel help 2>&1)")
    assert_match "kamel [command] --help", help_output.chomp

    get_output = shell_output("echo $(#{bin}/kamel get 2>&1)")
    assert_match "Error: cannot get command client: invalid configuration", get_output

    version_output = shell_output("echo $(#{bin}/kamel version 2>&1)")
    assert_match version.to_s, version_output
{'fraction_non_alphanumeric': 0.1175833107558927, 'fraction_numerical': 0.12435654294229206, 'mean_word_length': 4.5602409638554215, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 6, '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': '2831061', 'n_tokens_mistral': 1707, 'n_tokens_neox': 1417, 'n_words': 251}