Package de.saumya.mojo.ruby.script

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


        }
        else{
            scriptFactory.setSourceDir(new File(launchDirectory(), minitestDirectory));
        }

        final Script script = factory.newScript(scriptFactory.getCoreScript());
        if (this.minitestArgs != null) {
            script.addArgs(this.minitestArgs);
        }
        if (this.args != null) {
            script.addArgs(this.args);
        }

        try {
            script.executeIn(launchDirectory());
        } catch (Exception e) {
            getLog().debug("exception in running tests", e);
        }

        return resultManager.generateReports(mode, version, outputfile);
View Full Code Here


        }
        else if (!this.outputDirectory.exists()) {
            this.outputDirectory.mkdirs();
        }

        final Script script = this.factory.newScript(
                "\nrequire 'jruby/jrubyc'\n"
                        + "status = JRubyCompiler::compile_argv(ARGV)\n"
                        + "raise 'compilation-error(s)' if status !=0 && !"
                        + this.ignoreFailures);

        if (this.generateJava) {
            script.addArg("--java")
                .addArg("-t", fixPathSeparator(this.generatedJavaDirectory));
        } else {
            script.addArg("-t", fixPathSeparator(this.outputDirectory));
        }

        if( getJrubyVersion().hasJRubycVerbose() && (this.jrubyVerbose || this.jrubycVerbose)){
            script.addArg("--verbose");
        }
        // add current directory
        script.addArg(".");

        script.executeIn(this.rubyDirectory == null? this.rubySourceDirectory : this.rubyDirectory);
    }
View Full Code Here

            factory.addEnv("GEM_HOME", this.gemHome);
        }
        if (gemPath != null && !gemUseSystem){
            factory.addEnv("GEM_PATH", this.gemPath);
        }
        Script s;
        if (this.script != null && this.script.length() > 0) {
            s = this.factory.newScript(this.script);
        } else if (this.file != null) {
            s = this.factory.newScript(this.file);
        } else if (this.filename != null) {
            s = this.factory.newScriptFromSearchPath( this.filename );
        } else {
            s = this.factory.newArguments();
        }
        s.addArgs(this.args);
        s.addArgs(this.jrubyArgs);
        if (s.isValid()) {
            if(outputFile != null){
                s.executeIn(launchDirectory(), outputFile);
            }
            else {
                s.executeIn(launchDirectory());
            }
        } else {
            getLog()
                    .warn(
                            "no arguments given. use -Dargs=... or -Djruby.script=... or -Djruby.file=...");
View Full Code Here

       
        scriptFactory.setOutputDir( outputfile.getParentFile() );
        scriptFactory.setReportPath( outputfile );
        scriptFactory.setSourceDir( specsDir );

        final Script script = factory.newScript(scriptFactory.getCoreScript());
        if (this.rspecArgs != null) {
            script.addArgs(this.rspecArgs);
        }
        if (this.args != null) {
            script.addArgs(this.args);
        }

        Exception error = null;
        try {
            script.executeIn(launchDirectory());
        } catch (Exception e) {
            error = e;
            getLog().debug("exception in running specs", e);
        }
View Full Code Here

   
    @Override
    public void executeWithGems() throws MojoExecutionException,
            ScriptException, IOException, GemException {
        final Script script = this.factory.newScriptFromSearchPath("bundle");
        script.addArg("update");
        if (this.project.getBasedir() == null) {

            this.gemsInstaller.installGem("bundler",
                                          this.bundlerVersion,
                                          this.repoSession,
                                          this.localRepository,
                                          getRemoteRepos());

        }
        if (this.bundlerArgs != null) {
            script.addArgs(this.bundlerArgs);
        }
        if (this.args != null) {
            script.addArgs(this.args);
        }

        script.executeIn(launchDirectory());
    }
View Full Code Here

                                          this.repoSession,
                                          this.localRepository,
                                          getRemoteRepos() );

        }
        final Script script = this.factory.newScriptFromJRubyJar("rake");
        if (this.rakefile != null){
            script.addArg("-f", this.rakefile);
        }
       
        if (this.rakeArgs != null) {
            script.addArgs(this.rakeArgs);
        }
        if (this.args != null) {
            script.addArgs(this.args);
        }

        script.executeIn(launchDirectory());
    }
View Full Code Here

    protected String                  env;
   
    @Override
    public void executeWithGems() throws MojoExecutionException, ScriptException,
            IOException, GemException {   
        final Script script = factory.newScriptFromSearchPath("rake");
        script.addArgs(task);
        if(env != null && env.trim().length() > 0){
            script.addArg("RAILS_ENV=" + env);
        }
        if (this.rakeArgs != null) {
            script.addArgs(this.rakeArgs);
        }
        if (this.args != null) {
            script.addArgs(this.args);
        }
        script.executeIn(launchDirectory());
    }
View Full Code Here

                if (sha1.getParentFile().exists()) {
                    FileUtils.fileWrite(sha1, pomSha1);
                }
            }
        }
        final Script script = this.factory.newScriptFromSearchPath("bundle");
        script.addArg("install");
        if (this.project.getBasedir() == null) {

            this.gemsInstaller.installGem("bundler",
                                          this.bundlerVersion,
                                          this.repoSession,
                                          this.localRepository,
                                          getRemoteRepos());

        }
        else {
            if ( this.quiet ) {
                script.addArg("--quiet");
            }
            if ( this.local ) {
                script.addArg("--local");
            }
        }
        if (this.bundlerArgs != null) {
            script.addArgs(this.bundlerArgs);
        }
        if (this.args != null) {
            script.addArgs(this.args);
        }

        script.executeIn(launchDirectory());
       
        generateBinStubs();
    }
View Full Code Here

        }
        else{
            scriptFactory.setSourceDir(new File(launchDirectory(), runitDirectory));
        }

        final Script script = factory.newScript(scriptFactory.getCoreScript());
        if (this.runitArgs != null) {
            script.addArgs(this.runitArgs);
        }
        if (this.args != null) {
            script.addArgs(this.args);
        }

        try {
            script.executeIn(launchDirectory());
        } catch (Exception e) {
            getLog().debug("exception in running tests", e);
        }

        return resultManager.generateReports(mode, version, outputfile);
View Full Code Here

TOP

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

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.