<commit_before>#!/bin/bash

set -eu

HERE=$(dirname "$0")
HERE=$(readlink -f "$HERE")

cd "$HERE"

fresh-dir() {
  DIR=$1
  rm -rf "$DIR"
  mkdir -p "$DIR"
}

die() {
  echo "$@"
  exit 1
}

CACHED=$HERE/cached

tested-java-classes() {
  JUNIT=~/.net.sf.iwant/cached/UnmodifiableUrl/http%3A/%2Fmirrors.ibiblio.org/maven2/junit/junit/4.8.2/junit-4.8.2.jar
  IWANT_TESTAREA_PROJ=$HERE/../iwant-testarea
  IWANT_TESTRUNNER_PROJ=$HERE/../iwant-testrunner

  CLASSES_TO_TEST=$CACHED/classes-to-test
  fresh-dir "$CLASSES_TO_TEST"
  javac \
    -d "$CLASSES_TO_TEST" \
    -cp "$JUNIT" \<commit_msg>refresh.sh ensure junit.jar<commit_after>#!/bin/bash

set -eu

HERE=$(dirname "$0")
HERE=$(readlink -f "$HERE")

cd "$HERE"

fresh-dir() {
  DIR=$1
  rm -rf "$DIR"
  mkdir -p "$DIR"
}

die() {
  echo "$@"
  exit 1
}

CACHED=$HERE/cached

ensure-junit() {
  local JUNIT_HTTP_URL=mirrors.ibiblio.org/maven2/junit/junit/4.8.2/junit-4.8.2.jar
  JUNIT=~/.net.sf.iwant/cached/UnmodifiableUrl/http%3A/%2F$JUNIT_HTTP_URL
  [ -e "$JUNIT" ] || {
    local JUNIT_PARENT=$(dirname "$JUNIT")
    mkdir -p "$JUNIT_PARENT"
    wget "http://$JUNIT_HTTP_URL" -O "$JUNIT"
  }
}

tested-java-classes() {
  ensure-junit
  IWANT_TESTAREA_PROJ=$HERE/../iwant-testarea
  IWANT_TESTRUNNER_PROJ=$HERE/../iwant-testrunner

  CLASSES_TO_TEST=$CACHED/classes-to-test
  fresh-dir "$CLASSES_TO_TEST"
  javac \
    -d "$CLASSES_TO_TEST" \
    -cp "$JUNIT" \
{'fraction_non_alphanumeric': 0.19238900634249473, 'fraction_numerical': 0.016913319238900635, 'mean_word_length': 3.4654088050314464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2615796', 'n_tokens_mistral': 666, 'n_tokens_neox': 645, 'n_words': 88}