<commit_before>require 'formula'

class Henplus < Formula
  homepage 'https://github.com/neurolabs/henplus'
  url 'https://github.com/downloads/neurolabs/henplus/henplus-0.9.8.tar.gz'
  sha1 'ab1fc3a2ec5a6c8f434d2965d9bbe2121030ffd1'

  depends_on :ant => :build
  depends_on 'libreadline-java'

  def install
    ENV['JAVA_HOME'] = `/usr/libexec/java_home`.chomp

    inreplace 'bin/henplus' do |s|
      s.gsub! "LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"
      s.gsub! "$THISDIR/..", HOMEBREW_PREFIX
      s.gsub! "share/java/libreadline-java.jar",
              "share/libreadline-java/libreadline-java.jar"
    end

    system 'ant', 'install', "-Dprefix=#{prefix}"
  end

  def caveats; <<-EOS.undent
    You may need to set JAVA_HOME:
      export JAVA_HOME="$(/usr/libexec/java_home)"
    EOS<commit_msg>henplus: don't put /usr/local/lib in DYLD_LIBRARY_PATH<commit_after>require 'formula'

class Henplus < Formula
  homepage 'https://github.com/neurolabs/henplus'
  url 'https://github.com/downloads/neurolabs/henplus/henplus-0.9.8.tar.gz'
  sha1 'ab1fc3a2ec5a6c8f434d2965d9bbe2121030ffd1'

  depends_on :ant => :build
  depends_on 'libreadline-java'

  def install
    ENV['JAVA_HOME'] = `/usr/libexec/java_home`.chomp

    inreplace 'bin/henplus' do |s|
      s.gsub! "LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"
      s.change_make_var! "DYLD_LIBRARY_PATH", Formula["libreadline-java"].opt_lib
      s.gsub! "$THISDIR/..", HOMEBREW_PREFIX
      s.gsub! "share/java/libreadline-java.jar",
              "share/libreadline-java/libreadline-java.jar"
    end

    system 'ant', 'install', "-Dprefix=#{prefix}"
  end

  def caveats; <<-EOS.undent
    You may need to set JAVA_HOME:
      export JAVA_HOME="$(/usr/libexec/java_home)"
    EOS
{'fraction_non_alphanumeric': 0.1404720782959125, 'fraction_numerical': 0.029936672423719057, 'mean_word_length': 3.537859007832898, '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': '4979906', 'n_tokens_mistral': 741, 'n_tokens_neox': 686, 'n_words': 109}