<commit_before>require 'formula'

class Yuicompressor < Formula
  homepage 'http://yui.github.io/yuicompressor/'
  url 'https://github.com/yui/yuicompressor/releases/download/v2.4.8/yuicompressor-2.4.8.zip'
  sha1 '178e265570c8161e8074c7ca19896abb05e76c1f'

  def install
    libexec.install "yuicompressor-#{version}.jar"
    bin.write_jar_script libexec/"yuicompressor-#{version}.jar", "yuicompressor"
  end

  test do
    path = testpath/"test.js"
    path.write <<-EOS
      var i = 1;      // foo
      console.log(i); // bar<commit_msg>yuicompressor: modernize, https, sha256<commit_after>class Yuicompressor < Formula
  homepage "https://yui.github.io/yuicompressor/"
  url "https://github.com/yui/yuicompressor/releases/download/v2.4.8/yuicompressor-2.4.8.zip"
  sha256 "3243fd79cb68cc61a5278a8ff67a0ad6a2d825c36464594b66900ad8426a6a6e"

  def install
    libexec.install "yuicompressor-#{version}.jar"
    bin.write_jar_script libexec/"yuicompressor-#{version}.jar", "yuicompressor"
  end

  test do
    path = testpath/"test.js"
    path.write <<-EOS
      var i = 1;      // foo
      console.log(i); // bar
{'fraction_non_alphanumeric': 0.13327370304114491, 'fraction_numerical': 0.08139534883720931, 'mean_word_length': 3.6431535269709543, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '5968286', 'n_tokens_mistral': 512, 'n_tokens_neox': 454, 'n_words': 62}