Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package de.saumya.mojo.rails3;
 
 
 
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 MojoExecutionExceptionMojoFailureException {
        if (getJrubyVersion().toString().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,
            ScriptExceptionIOException {
        this..newScript(railsScriptFile())
                .addArg("console")
                .addArgs(this.)
                .addArgs(this.)
                .addArg(this.)
                .executeIn(launchDirectory());
    }
New to GrepCode? Check out our FAQ X