Package de.saumya.mojo.ruby.script

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


        }
        return jRubyVersion;
    }
   
    private ScriptFactory newScriptFactory() throws MojoExecutionException {
      ScriptFactory factory = createScriptFactory();
      if( env != null ){
        for( Map.Entry<String, String> entry: env.entrySet() ){
          factory.addEnv( entry.getKey(), entry.getValue() );
        }
      }
      return factory;
    }
View Full Code Here


    }
  }

    protected ScriptFactory newScriptFactory(Artifact artifact) throws MojoExecutionException {
        try {
            final ScriptFactory factory =
                artifact == null ?
                            new ScriptFactory(this.logger,
                                    this.classRealm,
                                    null,
                                    this.project.getTestClasspathElements(),
                                    this.jrubyFork):
                  (JRUBY_CORE.equals(artifact.getArtifactId()) ?
                    new ScriptFactory(this.logger,
                            this.classRealm,
                            artifact.getFile(),
                            resolveJRubyStdlibArtifact(artifact).getFile(),
                            this.project.getTestClasspathElements(),
                            this.jrubyFork) :
                    new ScriptFactory(this.logger,
                            this.classRealm,
                            artifact.getFile(),
                            this.project.getTestClasspathElements(),
                            this.jrubyFork) );

            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());
            }
            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());
            }
            return factory;
        } catch (final DependencyResolutionRequiredException e) {
            throw new MojoExecutionException("could not resolve jruby", e);
        } catch (final ScriptException e) {
View Full Code Here

TOP

Related Classes of de.saumya.mojo.ruby.script.ScriptFactory

Copyright © 2018 www.massapicom. 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.