org.jruby.util
Class ShellLauncher
java.lang.Object
org.jruby.util.ShellLauncher
public class ShellLauncher
- extends java.lang.Object
This mess of a class is what happens when all Java gives you is
Runtime.getRuntime().exec(). Thanks dude, that really helped.
- Author:
- nicksieger
|
Method Summary |
static java.lang.Process |
buildProcess(java.lang.String[] args,
java.lang.String[] env,
java.io.File pwd)
|
static int |
execAndWait(Ruby runtime,
IRubyObject[] rawArgs)
|
static int |
execAndWait(Ruby runtime,
IRubyObject[] rawArgs,
java.util.Map mergeEnv)
|
static long |
getPidFromProcess(java.lang.Process process)
|
static ShellLauncher.POpenProcess |
popen(Ruby runtime,
IRubyObject[] strings,
java.util.Map env,
ModeFlags modes)
|
static ShellLauncher.POpenProcess |
popen(Ruby runtime,
IRubyObject string,
ModeFlags modes)
|
static ShellLauncher.POpenProcess |
popen3(Ruby runtime,
IRubyObject[] strings)
|
static ShellLauncher.POpenProcess |
popen3(Ruby runtime,
IRubyObject[] strings,
boolean addShell)
|
static long |
reflectPidFromProcess(java.lang.Process process)
|
static java.lang.Process |
run(Ruby runtime,
IRubyObject string)
|
static java.lang.Process |
run(Ruby runtime,
IRubyObject[] rawArgs,
boolean doExecutableSearch)
|
static java.lang.Process |
run(Ruby runtime,
IRubyObject[] rawArgs,
boolean doExecutableSearch,
boolean forceExternalProcess)
|
static int |
runAndWait(Ruby runtime,
IRubyObject[] rawArgs)
|
static int |
runAndWait(Ruby runtime,
IRubyObject[] rawArgs,
java.io.OutputStream output)
|
static int |
runAndWait(Ruby runtime,
IRubyObject[] rawArgs,
java.io.OutputStream output,
boolean doExecutableSearch)
|
static long[] |
runAndWaitPid(Ruby runtime,
IRubyObject[] rawArgs)
|
static long[] |
runAndWaitPid(Ruby runtime,
IRubyObject[] rawArgs,
java.io.OutputStream output,
boolean doExecutableSearch)
|
static long |
runExternal(Ruby runtime,
IRubyObject env,
IRubyObject prog,
IRubyObject options,
IRubyObject args,
boolean wait)
|
static int |
runExternalAndWait(Ruby runtime,
IRubyObject[] rawArgs,
java.util.Map mergeEnv)
|
static long |
runExternalWithoutWait(Ruby runtime,
IRubyObject[] rawArgs)
|
static long |
runExternalWithoutWait(Ruby runtime,
IRubyObject env,
IRubyObject prog,
IRubyObject options,
IRubyObject args)
|
static long |
runWithoutWait(Ruby runtime,
IRubyObject[] rawArgs)
|
static java.io.InputStream |
unwrapBufferedStream(java.io.InputStream filteredStream)
Unwrap all filtering streams between the given stream and its actual
unfiltered stream. |
static java.io.OutputStream |
unwrapBufferedStream(java.io.OutputStream filteredStream)
Unwrap all filtering streams between the given stream and its actual
unfiltered stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ShellLauncher
public ShellLauncher()
runAndWait
public static int runAndWait(Ruby runtime,
IRubyObject[] rawArgs)
runAndWaitPid
public static long[] runAndWaitPid(Ruby runtime,
IRubyObject[] rawArgs)
runWithoutWait
public static long runWithoutWait(Ruby runtime,
IRubyObject[] rawArgs)
runExternalAndWait
public static int runExternalAndWait(Ruby runtime,
IRubyObject[] rawArgs,
java.util.Map mergeEnv)
runExternalWithoutWait
public static long runExternalWithoutWait(Ruby runtime,
IRubyObject env,
IRubyObject prog,
IRubyObject options,
IRubyObject args)
runExternal
public static long runExternal(Ruby runtime,
IRubyObject env,
IRubyObject prog,
IRubyObject options,
IRubyObject args,
boolean wait)
buildProcess
public static java.lang.Process buildProcess(java.lang.String[] args,
java.lang.String[] env,
java.io.File pwd)
throws java.io.IOException
- Throws:
java.io.IOException
runExternalWithoutWait
public static long runExternalWithoutWait(Ruby runtime,
IRubyObject[] rawArgs)
execAndWait
public static int execAndWait(Ruby runtime,
IRubyObject[] rawArgs)
execAndWait
public static int execAndWait(Ruby runtime,
IRubyObject[] rawArgs,
java.util.Map mergeEnv)
runAndWait
public static int runAndWait(Ruby runtime,
IRubyObject[] rawArgs,
java.io.OutputStream output)
runAndWait
public static int runAndWait(Ruby runtime,
IRubyObject[] rawArgs,
java.io.OutputStream output,
boolean doExecutableSearch)
runAndWaitPid
public static long[] runAndWaitPid(Ruby runtime,
IRubyObject[] rawArgs,
java.io.OutputStream output,
boolean doExecutableSearch)
getPidFromProcess
public static long getPidFromProcess(java.lang.Process process)
reflectPidFromProcess
public static long reflectPidFromProcess(java.lang.Process process)
run
public static java.lang.Process run(Ruby runtime,
IRubyObject string)
throws java.io.IOException
- Throws:
java.io.IOException
popen
public static ShellLauncher.POpenProcess popen(Ruby runtime,
IRubyObject string,
ModeFlags modes)
throws java.io.IOException
- Throws:
java.io.IOException
popen
public static ShellLauncher.POpenProcess popen(Ruby runtime,
IRubyObject[] strings,
java.util.Map env,
ModeFlags modes)
throws java.io.IOException
- Throws:
java.io.IOException
popen3
public static ShellLauncher.POpenProcess popen3(Ruby runtime,
IRubyObject[] strings)
throws java.io.IOException
- Throws:
java.io.IOException
popen3
public static ShellLauncher.POpenProcess popen3(Ruby runtime,
IRubyObject[] strings,
boolean addShell)
throws java.io.IOException
- Throws:
java.io.IOException
unwrapBufferedStream
public static java.io.OutputStream unwrapBufferedStream(java.io.OutputStream filteredStream)
- Unwrap all filtering streams between the given stream and its actual
unfiltered stream. This is primarily to unwrap streams that have
buffers that would interfere with interactivity.
- Parameters:
filteredStream - The stream to unwrap
- Returns:
- An unwrapped stream, presumably unbuffered
unwrapBufferedStream
public static java.io.InputStream unwrapBufferedStream(java.io.InputStream filteredStream)
- Unwrap all filtering streams between the given stream and its actual
unfiltered stream. This is primarily to unwrap streams that have
buffers that would interfere with interactivity.
- Parameters:
filteredStream - The stream to unwrap
- Returns:
- An unwrapped stream, presumably unbuffered
run
public static java.lang.Process run(Ruby runtime,
IRubyObject[] rawArgs,
boolean doExecutableSearch)
throws java.io.IOException
- Throws:
java.io.IOException
run
public static java.lang.Process run(Ruby runtime,
IRubyObject[] rawArgs,
boolean doExecutableSearch,
boolean forceExternalProcess)
throws java.io.IOException
- Throws:
java.io.IOException
Copyright © 2002-2009 JRuby Team. All Rights Reserved.