Package org.jruby.util
Class ShellLauncher
java.lang.Object
org.jruby.util.ShellLauncher
This mess of a class is what happens when all Java gives you is
Runtime.getRuntime().exec(). Thanks dude, that really helped.
- Author:
- nicksieger
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Process
buildProcess
(Ruby runtime, String[] args, String[] env, File pwd) static String
changeDirInsideJar
(Ruby runtime, String arg) static int
execAndWait
(Ruby runtime, IRubyObject[] rawArgs) static int
execAndWait
(Ruby runtime, IRubyObject[] rawArgs, Map mergeEnv) static File
findPathExecutable
(Ruby runtime, String fname) static File
findPathExecutable
(Ruby runtime, String fname, IRubyObject pathObject) Deprecated.static File
findPathExecutable
(ThreadContext context, String fname, IRubyObject pathObject) static String[]
getCurrentEnv
(Ruby runtime) static String[]
getModifiedEnv
(Ruby runtime, Collection mergeEnv, boolean clearEnv) Deprecated.static String[]
getModifiedEnv
(ThreadContext context, Collection mergeEnv, boolean clearEnv) static long
getPidFromProcess
(Process process) static ShellLauncher.POpenProcess
popen
(Ruby runtime, IRubyObject[] strings, Map env, IOOptions modes) Deprecated.static ShellLauncher.POpenProcess
popen
(Ruby runtime, IRubyObject[] strings, Map env, ModeFlags modes) static ShellLauncher.POpenProcess
popen
(Ruby runtime, IRubyObject string, Map env, ModeFlags modes) static ShellLauncher.POpenProcess
popen
(Ruby runtime, IRubyObject string, IOOptions modes) Deprecated.static ShellLauncher.POpenProcess
popen
(Ruby runtime, IRubyObject string, ModeFlags modes) static ShellLauncher.POpenProcess
popen3
(Ruby runtime, IRubyObject[] strings) Deprecated.static ShellLauncher.POpenProcess
popen3
(Ruby runtime, IRubyObject[] strings, boolean addShell) Deprecated.static long
reflectPidFromProcess
(Process process) static Process
run
(Ruby runtime, Map env, String dir, IRubyObject[] rawArgs, boolean doExecutableSearch, boolean forceExternalProcess) static Process
run
(Ruby runtime, IRubyObject string) static Process
run
(Ruby runtime, IRubyObject[] rawArgs, boolean doExecutableSearch) static Process
run
(Ruby runtime, IRubyObject[] rawArgs, boolean doExecutableSearch, boolean forceExternalProcess) static int
runAndWait
(Ruby runtime, IRubyObject[] rawArgs) static int
runAndWait
(Ruby runtime, IRubyObject[] rawArgs, OutputStream output) static int
runAndWait
(Ruby runtime, IRubyObject[] rawArgs, OutputStream output, boolean doExecutableSearch) static long[]
runAndWaitPid
(Ruby runtime, IRubyObject[] rawArgs) static long[]
runAndWaitPid
(Ruby runtime, IRubyObject[] rawArgs, 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, 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 boolean
shouldUseShell
(String command) static InputStream
unwrapBufferedStream
(InputStream filteredStream) Deprecated.static OutputStream
unwrapBufferedStream
(OutputStream filteredStream) Deprecated.static InputStream
unwrapFilterInputStream
(InputStream filteredStream) Deprecated.static OutputStream
unwrapFilterOutputStream
(OutputStream filteredStream) Deprecated.
-
Constructor Details
-
ShellLauncher
public ShellLauncher()
-
-
Method Details
-
getCurrentEnv
-
getModifiedEnv
@Deprecated public static String[] getModifiedEnv(Ruby runtime, Collection mergeEnv, boolean clearEnv) Deprecated. -
getModifiedEnv
-
findPathExecutable
-
findPathExecutable
@Deprecated(since="10.0") public static File findPathExecutable(Ruby runtime, String fname, IRubyObject pathObject) Deprecated. -
findPathExecutable
-
runAndWait
-
runAndWaitPid
-
runWithoutWait
-
runExternalAndWait
-
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) -
changeDirInsideJar
-
buildProcess
public static Process buildProcess(Ruby runtime, String[] args, String[] env, File pwd) throws IOException - Throws:
IOException
-
runExternalWithoutWait
-
execAndWait
-
execAndWait
-
runAndWait
-
runAndWait
public static int runAndWait(Ruby runtime, IRubyObject[] rawArgs, OutputStream output, boolean doExecutableSearch) -
runAndWaitPid
public static long[] runAndWaitPid(Ruby runtime, IRubyObject[] rawArgs, OutputStream output, boolean doExecutableSearch) -
getPidFromProcess
-
reflectPidFromProcess
-
run
- Throws:
IOException
-
popen
public static ShellLauncher.POpenProcess popen(Ruby runtime, IRubyObject string, ModeFlags modes) throws IOException - Throws:
IOException
-
popen
public static ShellLauncher.POpenProcess popen(Ruby runtime, IRubyObject[] strings, Map env, ModeFlags modes) throws IOException - Throws:
IOException
-
popen
public static ShellLauncher.POpenProcess popen(Ruby runtime, IRubyObject string, Map env, ModeFlags modes) throws IOException - Throws:
IOException
-
popen
@Deprecated public static ShellLauncher.POpenProcess popen(Ruby runtime, IRubyObject string, IOOptions modes) throws IOException Deprecated.- Throws:
IOException
-
popen
@Deprecated public static ShellLauncher.POpenProcess popen(Ruby runtime, IRubyObject[] strings, Map env, IOOptions modes) throws IOException Deprecated.- Throws:
IOException
-
popen3
@Deprecated public static ShellLauncher.POpenProcess popen3(Ruby runtime, IRubyObject[] strings) throws IOException Deprecated.- Throws:
IOException
-
popen3
@Deprecated public static ShellLauncher.POpenProcess popen3(Ruby runtime, IRubyObject[] strings, boolean addShell) throws IOException Deprecated.- Throws:
IOException
-
run
public static Process run(Ruby runtime, IRubyObject[] rawArgs, boolean doExecutableSearch) throws IOException - Throws:
IOException
-
run
public static Process run(Ruby runtime, IRubyObject[] rawArgs, boolean doExecutableSearch, boolean forceExternalProcess) throws IOException - Throws:
IOException
-
run
public static Process run(Ruby runtime, Map env, String dir, IRubyObject[] rawArgs, boolean doExecutableSearch, boolean forceExternalProcess) throws IOException - Throws:
IOException
-
shouldUseShell
-
unwrapBufferedStream
Deprecated. -
unwrapBufferedStream
Deprecated. -
unwrapFilterOutputStream
Deprecated. -
unwrapFilterInputStream
Deprecated.
-