<commit_before>require 'formula'

class Htmlcompressor < Formula
  homepage 'http://code.google.com/p/htmlcompressor/'
  url 'http://htmlcompressor.googlecode.com/files/htmlcompressor-1.5.3.jar'
  sha1 '57db73b92499e018b2f2978f1c7aa7b1238c7a39'

  option 'yuicompressor', "Use YUICompressor for JS/CSS compression"

  depends_on "yuicompressor" => :optional if build.include? 'yuicompressor'

  def install
    libexec.install "htmlcompressor-1.5.3.jar"
    bin.write_jar_script libexec/"htmlcompressor-1.5.3.jar", "htmlcompressor"

    if build.include? 'yuicompressor'
      yui = Formula.factory('yuicompressor')
      yui_jar = "yuicompressor-#{yui.version}.jar"
      ln_s "#{yui.libexec}/#{yui_jar}", "#{libexec}/#{yui_jar}"
    end
  end
end<commit_msg>htmlcompressor: Add Closure Compiler support<commit_after>require 'formula'

class Htmlcompressor < Formula
  homepage 'http://code.google.com/p/htmlcompressor/'
  url 'http://htmlcompressor.googlecode.com/files/htmlcompressor-1.5.3.jar'
  sha1 '57db73b92499e018b2f2978f1c7aa7b1238c7a39'

  option 'yuicompressor', "Use YUICompressor for JS/CSS compression"
  option 'closure-compiler', "Use Closure Compiler for JS optimization"

  depends_on "yuicompressor" => :optional if build.include? 'yuicompressor'
  depends_on "closure-compiler" => :optional if build.include? 'closure-compiler'

  def install
    libexec.install "htmlcompressor-1.5.3.jar"
    bin.write_jar_script libexec/"htmlcompressor-1.5.3.jar", "htmlcompressor"

    if build.include? 'yuicompressor'
      yui = Formula.factory('yuicompressor')
      yui_jar = "yuicompressor-#{yui.version}.jar"
      ln_s "#{yui.libexec}/#{yui_jar}", "#{libexec}/#{yui_jar}"
    end

    if build.include? 'closure-compiler'
      closure = Formula.factory('closure-compiler')
      ln_s "#{closure.libexec}/build/compiler.jar", "#{libexec}/compiler.jar"
    end
  end
end
{'fraction_non_alphanumeric': 0.13421750663129972, 'fraction_numerical': 0.039257294429708225, 'mean_word_length': 4.466666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, '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': '5183950', 'n_tokens_mistral': 741, 'n_tokens_neox': 697, 'n_words': 114}