<commit_before>module ServerRunner
  def run_server(name, &block)
    let! name do
      server = block.call
      thread = Thread.new { server.start }

      Thread.pass while thread.status != "sleep"

      server
    end

    after do
      send(name).shutdown
    end
  end
end

RSpec.configure { |c| c.extend ServerRunner }<commit_msg>Fix server runner helper on JRuby<commit_after>module ServerRunner
  def run_server(name, &block)
    let! name do
      server = block.call

      Thread.new { server.start }

      server
    end

    after do
      send(name).shutdown
    end
  end
end

RSpec.configure { |c| c.extend ServerRunner }
{'fraction_non_alphanumeric': 0.08255451713395638, 'fraction_numerical': 0.0, 'mean_word_length': 2.4756756756756757, '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': '1531123', 'n_tokens_mistral': 206, 'n_tokens_neox': 197, 'n_words': 58}