<commit_before># -*- coding: utf-8 -*-
require 'stringio'
require 'submission_runners/base'

module SubmissionRunners
  class Java < Base
    def call
      build
      run
    end

    def image
      "java:8"
    end

    private

    def build
      submission_dir.chmod(0777)

      puts "mode of #{submission_dir.to_s}: #{submission_dir.stat.mode.to_s(8)}"

      options = [
        "--name #{build_container}",
        "--volume #{submission_dir}:/workspace",
        "--workdir /workspace",
        "--user #{container_user}",
        "--rm",
      ].join(" ")

      run_command(
        "docker run #{options} #{image} javac #{source_file.basename}"
      )
    end

    def run
      options = [
        "--name #{run_container}",
        "--volume #{submission_dir}:/workspace",
        "--workdir /workspace",
        "--user #{container_user}",
        "--rm",
        "--attach STDIN",
        "--attach STDOUT",<commit_msg>the travis ci website machine finally smiled on my endeavors<commit_after># -*- coding: utf-8 -*-
require 'stringio'
require 'submission_runners/base'

module SubmissionRunners
  class Java < Base
    def call
      build
      run
    end

    def image
      "java:8"
    end

    private

    def build
      submission_dir.chmod(0777)

      options = [
        "--name #{build_container}",
        "--volume #{submission_dir}:/workspace",
        "--workdir /workspace",
        "--user #{container_user}",
        "--rm",
      ].join(" ")

      run_command(
        "docker run #{options} #{image} javac #{source_file.basename}"
      )
    end

    def run
      options = [
        "--name #{run_container}",
        "--volume #{submission_dir}:/workspace",
        "--workdir /workspace",
        "--user #{container_user}",
        "--rm",
        "--attach STDIN",
        "--attach STDOUT",
{'fraction_non_alphanumeric': 0.15138361367335865, 'fraction_numerical': 0.00705371676614216, 'mean_word_length': 1.9085173501577286, 'pattern_counts': {'":': 0, '<': 5, '<?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': '337738', 'n_tokens_mistral': 573, 'n_tokens_neox': 553, 'n_words': 133}