Examples of GemScriptFactory


Examples of de.saumya.mojo.ruby.script.GemScriptFactory

    }

    @Override
    protected ScriptFactory newScriptFactory(Artifact artifact) throws MojoExecutionException {
        try {
            final GemScriptFactory factory =
                    artifact == null ?
                            new GemScriptFactory(this.logger,
                                    this.classRealm,
                                    null,
                                    this.project.getTestClasspathElements(),
                                    this.jrubyFork,
                                    this.gemsConfig):
                        (JRUBY_CORE.equals(artifact.getArtifactId()) ?
                    new GemScriptFactory(this.logger,
                                  this.classRealm,
                                  artifact.getFile(),
                                  resolveJRubyStdlibArtifact(artifact).getFile(),
                                  this.project.getTestClasspathElements(),
                                  this.jrubyFork,
                                  this.gemsConfig) :
                    new GemScriptFactory(this.logger,
                                  this.classRealm,
                                  artifact.getFile(),
                                  this.project.getTestClasspathElements(),
                                  this.jrubyFork,
                                  this.gemsConfig));
                 
            if(supportNative){
                factory.addJvmArgs("-Djruby.home=" + setupNativeSupport().getAbsolutePath());
            }
            if(rubySourceDirectory != null && rubySourceDirectory.exists()){
                if(jrubyVerbose){
                    getLog().info("add to ruby loadpath: " + rubySourceDirectory.getAbsolutePath());
                }
                // add it to the load path for all scripts using that factory
                factory.addSwitch("-I", rubySourceDirectory.getAbsolutePath());
            }
            if( libDirectory != null && libDirectory.exists() ){
                if(jrubyVerbose){
                    getLog().info("add to ruby loadpath: " + libDirectory.getAbsolutePath());
                }
                // add it to the load path for all scripts using that factory
                factory.addSwitch("-I", libDirectory.getAbsolutePath());
            }

            return factory;
        }
        catch (final DependencyResolutionRequiredException e) {
View Full Code Here

Examples of de.saumya.mojo.ruby.script.GemScriptFactory

        this.expected = "onetwothree" + SEP + this.home.getAbsolutePath() + SEP
                + this.path.getAbsolutePath() + SEP;

        final Logger logger = new NoopLogger();
        // no classrealm
        this.factory = new GemScriptFactory(logger,
                null,
                new File(""),
                new File(""),
                classpathElements,
                false, config);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.