<commit_before>class Ballerina < Formula
  desc "The flexible, powerful and beautiful programming language"
  homepage "https://ballerina.io/"
  url "https://product-dist.ballerina.io/downloads/0.991.0/ballerina-0.991.0.zip"
  sha256 "be7d039c42e8882572f58c1f67e8dbf6e3c4ca719190a4e7da1405dd595ca66b"

  bottle :unneeded

  depends_on :java => "1.8"

  def install
    # Remove Windows files
    rm Dir["bin/*.bat"]

    chmod 0755, "bin/ballerina"

    inreplace ["bin/ballerina"] do |s|
      s.gsub! /^BALLERINA_HOME=.*$/, "BALLERINA_HOME=#{libexec}"
      s.gsub! /\r?/, ""
    end

    bin.install "bin/ballerina"
    libexec.install Dir["*"]
    # Add symlinks for the Language Server
    prefix.install_symlink libexec/"bre"
    prefix.install_symlink libexec/"lib"
    bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("1.8"))
  end

  test do
    (testpath/"helloWorld.bal").write <<~EOS
      import ballerina/io;
      public function main(string... args) {
        io:println("Hello, World!");
      }
    EOS
    output = shell_output("#{bin}/ballerina run helloWorld.bal")
    assert_equal "Hello, World!", output.chomp
  end
end<commit_msg>ballerina 1.0.0 (#44320)<commit_after>class Ballerina < Formula
  desc "A Programming Language for Network Distributed Applications"
  homepage "https://v1-0.ballerina.io"
  url "https://product-dist.ballerina.io/downloads/1.0.0/jballerina-1.0.0.zip"
  sha256 "2fe11f64743ed9ee2218e6e8cef962bd120ab073324281c9f6e9cbae5dd0f326"

  bottle :unneeded

  depends_on :java => "1.8"

  def install
    # Remove Windows files
    rm Dir["bin/*.bat"]

    chmod 0755, "bin/ballerina"

    inreplace ["bin/ballerina"] do |s|
      s.gsub! /^BALLERINA_HOME=.*$/, "BALLERINA_HOME=#{libexec}"
      s.gsub! /\r?/, ""
    end

    bin.install "bin/ballerina"
    libexec.install Dir["*"]
    # Add symlinks for the Language Server
    prefix.install_symlink libexec/"bre"
    prefix.install_symlink libexec/"lib"
    bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("1.8"))
  end

  test do
    (testpath/"helloWorld.bal").write <<~EOS
      import ballerina/io;
      public function main() {
        io:println("Hello, World!");
      }
    EOS
    output = shell_output("#{bin}/ballerina run helloWorld.bal")
    assert_equal "Hello, World!", output.chomp
  end
end
{'fraction_non_alphanumeric': 0.13798977853492334, 'fraction_numerical': 0.05323679727427598, 'mean_word_length': 3.398876404494382, 'pattern_counts': {'":': 0, '<': 9, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3906880', 'n_tokens_mistral': 945, 'n_tokens_neox': 870, 'n_words': 164}