Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package de.saumya.mojo.rails3;
 
 
 import  org.apache.maven.plugin.MojoExecutionException;
 import  org.apache.maven.plugin.MojoFailureException;
 
 import  de.saumya.mojo.ruby.RubyScriptException;

goal to run the rails console. it will ignore the fork parameter since forking does not work with a console.

Goal:
console
RequiresDependencyResolution:
compile
public class ConsoleMojo extends AbstractRailsMojo {

    
arguments for the console command

Parameter:
default-value="${console.args}"
    protected String consoleArgs = null;
    @Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        if (this. != null
                && this..compareTo("1.5.0") < 0) {
            throw new MojoExecutionException("does not work with jruby version < 1.5.0");
        }
        // make sure the whole things run in the same process
        this. = false;
        super.execute();
    }
    @Override
    public void executeRails() throws MojoExecutionException,
            RubyScriptException, IOException {
        this..newScript(railsScriptFile())
                .addArg("console")
                .addArgs(this.)
                .addArgs(this.)
                .addArg(this.)
                .executeIn(launchDirectory());
    }
New to GrepCode? Check out our FAQ X