<commit_before>package sfc

/**
 * @author <EMAIL>
 */
class SetterForCatan {
    def configuration
    def library
    def executable

    String execute(String boardConfigurationType, List<String> extraArgs=[]) {
        final boardConfigurationName =
            camelCaseToHyphenated(boardConfigurationType[0].toLowerCase() + boardConfigurationType.substring(1))

        final classpath = configuration.inject(library.toString()) { String accum, File file ->
            "${accum}:${file}"
        }
        final env = [
                "CLASSPATH=${classpath}",
                "JAVA_HOME=${System.getenv('JAVA_HOME')}",
                "SCALA_HOME=${System.getenv('SCALA_HOME')}"
        ]

        final command = [executable.toString(), boardConfigurationName]
        command.addAll(extraArgs)

        final process = command.execute(env, null)

        process.text
    }

    void createScript(File script) {
        final classpath = configuration.inject(library.toString()) { String accum, File file ->
            "${accum}:${file}"
        }

        script << ('#!/bin/bash\n')
        script << ('\n')
        script << ("export CLASSPATH=${classpath}\n")
        script << ("export JAVA_HOME=${System.getenv('JAVA_HOME')}\n")
        script << ("export SCALA_HOME=${System.getenv('SCALA_HOME')}\n")
        script << ('\n')
        script << ("${executable} \"\$@\"\n")
    }

    private static String camelCaseToHyphenated(final camelCasedString) {
        int index = indexOfUpperCaseLetter(camelCasedString, 0)
        if (index == -1) {
            camelCasedString
        } else {
            String result = ''

            def range = 0..<index
            while (index != -1) {
                result += camelCasedString[range] + '-' + camelCasedString[index].toLowerCase()
                index = indexOfUpperCaseLetter(camelCasedString, index + 1)
                range = range.to+2..<index
            }

            result + camelCasedString.substring(range.to as int)
        }
    }<commit_msg>Generated script made executable.<commit_after>package sfc

/**
 * @author <EMAIL>
 */
class SetterForCatan {
    def configuration
    def library
    def executable

    String execute(String boardConfigurationType, List<String> extraArgs=[]) {
        final boardConfigurationName =
            camelCaseToHyphenated(boardConfigurationType[0].toLowerCase() + boardConfigurationType.substring(1))

        final classpath = configuration.inject(library.toString()) { String accum, File file ->
            "${accum}:${file}"
        }
        final env = [
                "CLASSPATH=${classpath}",
                "JAVA_HOME=${System.getenv('JAVA_HOME')}",
                "SCALA_HOME=${System.getenv('SCALA_HOME')}"
        ]

        final command = [executable.toString(), boardConfigurationName]
        command.addAll(extraArgs)

        final process = command.execute(env, null)

        process.text
    }

    void createScript(File script) {
        final classpath = configuration.inject(library.toString()) { String accum, File file ->
            "${accum}:${file}"
        }

        script << ('#!/bin/bash\n')
        script << ('\n')
        script << ("export CLASSPATH=${classpath}\n")
        script << ("export JAVA_HOME=${System.getenv('JAVA_HOME')}\n")
        script << ("export SCALA_HOME=${System.getenv('SCALA_HOME')}\n")
        script << ('\n')
        script << ("${executable} \"\$@\"\n")

        script.setExecutable(true)
    }

    private static String camelCaseToHyphenated(final camelCasedString) {
        int index = indexOfUpperCaseLetter(camelCasedString, 0)
        if (index == -1) {
            camelCasedString
        } else {
            String result = ''

            def range = 0..<index
            while (index != -1) {
                result += camelCasedString[range] + '-' + camelCasedString[index].toLowerCase()
                index = indexOfUpperCaseLetter(camelCasedString, index + 1)
                range = range.to+2..<index
            }

            result + camelCasedString.substring(range.to as int)
        }
    }
{'fraction_non_alphanumeric': 0.13501699854298202, 'fraction_numerical': 0.003885381253035454, 'mean_word_length': 2.2331240188383044, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 11, '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': '2553254', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1144, 'n_words': 220}