Examples of processArguments()


Examples of org.jruby.RubyInstanceConfig.processArguments()

        assertTrue(c.isAssumeLoop());
        assertEquals("myfile.rb", c.getScriptFileName());
        assertEquals("myfile.rb", c.displayedFileName());

        c = new RubyInstanceConfig();
        c.processArguments(new String[0]);
        assertEquals("-", c.displayedFileName());
    }

    public void testParsingWithDashDash() {
        class TestableCommandlineParser extends RubyInstanceConfig {
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

    }

    public void testHelpDoesNotRunIntepreter() {
        String[] args = new String[]{"-h"};
        RubyInstanceConfig parser = new RubyInstanceConfig();
        parser.processArguments(args);
        assertFalse(parser.isShouldRunInterpreter());

        args = new String[]{"--help"};
        parser = new RubyInstanceConfig();
        parser.processArguments(args);
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

        parser.processArguments(args);
        assertFalse(parser.isShouldRunInterpreter());

        args = new String[]{"--help"};
        parser = new RubyInstanceConfig();
        parser.processArguments(args);
        assertFalse(parser.isShouldRunInterpreter());
    }

    public void testCommandTakesOneArgument() {
        String[] args = new String[]{"--command", "gem"};
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

    }

    public void testCommandTakesOneArgument() {
        String[] args = new String[]{"--command", "gem"};
        RubyInstanceConfig parser = new RubyInstanceConfig();
        parser.processArguments(args);
        assertEquals(1, parser.requiredLibraries().size());
        assertEquals("jruby/commands", parser.requiredLibraries().get(0));
        assertEquals("JRuby::Commands.gem\n", new String(parser.inlineScript()));
    }
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

    }

    public void testCommandAllowedOnlyOnceAndRemainderAreScriptArgs() {
        String[] args = new String[]{"--command", "gem", "--command", "irb"};
        RubyInstanceConfig parser = new RubyInstanceConfig();
        parser.processArguments(args);
        assertEquals(2, parser.getArgv().length);
        assertEquals("--command", parser.getArgv()[0]);
        assertEquals("irb", parser.getArgv()[1]);
    }
}
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

        super(testName);
    }

    public void testLineNumbersForNativeTracer() {
        RubyInstanceConfig config = new RubyInstanceConfig();
        config.processArguments(new String[]{"--debug"});
        Ruby rt = JavaEmbedUtils.initialize(Collections.emptyList(), config);
        NativeTracer tracer = new NativeTracer();
        rt.addEventHook(tracer);
        RubyRuntimeAdapter evaler = JavaEmbedUtils.newRuntimeAdapter();
        evaler.eval(rt, "sleep 0.01\nsleep 0.01\nsleep 0.01");
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

        err = new PrintStream(new ByteArrayOutputStream());
    }

    public void testParsing() {
        RubyInstanceConfig c = new RubyInstanceConfig();
        c.processArguments(new String[]{"-e", "hello", "-e", "world"});
        assertEquals("hello\nworld\n", new String(c.inlineScript()));
        assertNull(c.getScriptFileName());
        assertEquals("-e", c.displayedFileName());

        c = new RubyInstanceConfig();
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

        assertEquals("hello\nworld\n", new String(c.inlineScript()));
        assertNull(c.getScriptFileName());
        assertEquals("-e", c.displayedFileName());

        c = new RubyInstanceConfig();
        c.processArguments(new String[]{"--version"});
        assertTrue(c.isShowVersion());

        c = new RubyInstanceConfig();
        c.processArguments(new String[]{"-n", "myfile.rb"});
        assertTrue(c.isAssumeLoop());
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

        c = new RubyInstanceConfig();
        c.processArguments(new String[]{"--version"});
        assertTrue(c.isShowVersion());

        c = new RubyInstanceConfig();
        c.processArguments(new String[]{"-n", "myfile.rb"});
        assertTrue(c.isAssumeLoop());
        assertEquals("myfile.rb", c.getScriptFileName());
        assertEquals("myfile.rb", c.displayedFileName());

        c = new RubyInstanceConfig();
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

        assertTrue(c.isAssumeLoop());
        assertEquals("myfile.rb", c.getScriptFileName());
        assertEquals("myfile.rb", c.displayedFileName());

        c = new RubyInstanceConfig();
        c.processArguments(new String[0]);
        assertEquals("-", c.displayedFileName());
    }

    public void testParsingWithDashDash() {
        class TestableCommandlineParser extends RubyInstanceConfig {
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.