<commit_before>package com.github.jrubygradle.jar

import com.github.jrubygradle.internal.WarblerBootstrap
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.testing.Test

/**
 * @author <NAME>
 */
class JRubyJarPlugin implements Plugin<Project> {
    void apply(Project project) {

        project.apply plugin : 'com.github.jruby-gradle.base'
        project.configurations.maybeCreate('jrubyEmbeds')

        // In order to update the testing cycle we need to tell unit tests where to
        // find GEMs. We are assuming that if someone includes this plugin, that they
        // will be writing tests that includes jruby and that they might need some
        // GEMs as part of the tests.
        def testConfiguration = { Task t ->
            environment GEM_HOME : project.extensions.getByName('jruby').gemInstallDir
            dependsOn 'jrubyPrepareGems'
        }
        try {
            Task t = project.tasks.getByName('test')
            if( t instanceof Test) {
                project.configure(t,testConfiguration)
            }
        } catch(UnknownTaskException) {
            project.tasks.whenTaskAdded { Task t ->
                if(t.name == 'test' && t instanceof Test) {
                    project.configure(t,testConfiguration)
                }
            }<commit_msg>Fixed the dependency 'jar' from 'java' plugin needs to have on 'jrubyPrepareGems'<commit_after>package com.github.jrubygradle.jar

import com.github.jrubygradle.internal.WarblerBootstrap
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.testing.Test

/**
 * @author <NAME>
 */
class JRubyJarPlugin implements Plugin<Project> {
    void apply(Project project) {

        project.apply plugin : 'com.github.jruby-gradle.base'
        project.configurations.maybeCreate('jrubyEmbeds')

        // In order to update the testing cycle we need to tell unit tests where to
        // find GEMs. We are assuming that if someone includes this plugin, that they
        // will be writing tests that includes jruby and that they might need some
        // GEMs as part of the tests.
        def testConfiguration = { Task t ->
            environment GEM_HOME : project.extensions.getByName('jruby').gemInstallDir
            dependsOn 'jrubyPrepareGems'
        }
        try {
            Task t = project.tasks.getByName('test')
            if( t instanceof Test) {
                project.configure(t,testConfiguration)
            }
        } catch(UnknownTaskException) {
            project.tasks.whenTaskAdded { Task t ->
                if(t.name == 'test' && t instanceof Test) {
                    project.configure(t,testConfiguration)
                } else if (t.name == 'jar' && t instanceof Jar) {
                    t.dependsOn 'jrubyPrepareGems'
                }
            }
{'fraction_non_alphanumeric': 0.08997000999666778, 'fraction_numerical': 0.0, 'mean_word_length': 2.266594124047878, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4669574', 'n_tokens_mistral': 847, 'n_tokens_neox': 799, 'n_words': 224}