<commit_before>package com.redhat.ceylon.compiler.java.runtime.tools.impl;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Map;
import java.util.Set;

import com.redhat.ceylon.cmr.api.RepositoryManager;
import com.redhat.ceylon.common.ModuleUtil;
import com.redhat.ceylon.compiler.java.runtime.tools.Runner;
import com.redhat.ceylon.compiler.java.runtime.tools.RunnerOptions;
import com.redhat.ceylon.compiler.js.CeylonRunJsTool;

public class JavaScriptRunnerImpl implements Runner {

    private CeylonRunJsTool tool;
    private String moduleSpec;

    public JavaScriptRunnerImpl(final RunnerOptions options, String module, String version) {
        tool = new CeylonRunJsTool() {
            @Override
            protected void customizeDependencies(Set<File> localRepos, RepositoryManager repoman) throws IOException {
                for (Map.Entry<String,String> extraModule : options.getExtraModules().entrySet()) {
                    String modName = extraModule.getKey();
                    String modVersion = extraModule.getValue();
                    File artifact = getArtifact(modName, modVersion, repoman);
                    localRepos.add(getRepoDir(modName, artifact));
                    loadDependencies(localRepos, repoman, artifact);
                }
            };
        };

        moduleSpec = ModuleUtil.makeModuleName(module, version);
        tool.setThrowOnError(true);
        tool.setModuleVersion(moduleSpec);
        try {
            tool.setRepositoryAsStrings(options.getUserRepositories());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        tool.setSystemRepository(options.getSystemRepository());
        tool.setOffline(options.isOffline());
        if(options.isVerbose())
            tool.setVerbose("");<commit_msg>Minor change because of API change to the JS runner tool.<commit_after>package com.redhat.ceylon.compiler.java.runtime.tools.impl;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Map;
import java.util.Set;

import com.redhat.ceylon.cmr.api.RepositoryManager;
import com.redhat.ceylon.common.ModuleUtil;
import com.redhat.ceylon.compiler.java.runtime.tools.Runner;
import com.redhat.ceylon.compiler.java.runtime.tools.RunnerOptions;
import com.redhat.ceylon.compiler.js.CeylonRunJsTool;

public class JavaScriptRunnerImpl implements Runner {

    private CeylonRunJsTool tool;
    private String moduleSpec;

    public JavaScriptRunnerImpl(final RunnerOptions options, String module, String version) {
        tool = new CeylonRunJsTool() {
            @Override
            protected void customizeDependencies(Set<File> localRepos, RepositoryManager repoman) throws IOException {
                for (Map.Entry<String,String> extraModule : options.getExtraModules().entrySet()) {
                    String modName = extraModule.getKey();
                    String modVersion = extraModule.getValue();
                    File artifact = getArtifact(repoman, modName, modVersion, true);
                    localRepos.add(getRepoDir(modName, artifact));
                    loadDependencies(localRepos, repoman, artifact);
                }
            };
        };

        moduleSpec = ModuleUtil.makeModuleName(module, version);
        tool.setThrowOnError(true);
        tool.setModuleVersion(moduleSpec);
        try {
            tool.setRepositoryAsStrings(options.getUserRepositories());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        tool.setSystemRepository(options.getSystemRepository());
        tool.setOffline(options.isOffline());
        if(options.isVerbose())
            tool.setVerbose("");
{'fraction_non_alphanumeric': 0.09627659574468085, 'fraction_numerical': 0.0, 'mean_word_length': 2.873326467559217, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1223478', 'n_tokens_mistral': 1020, 'n_tokens_neox': 991, 'n_words': 190}