|
From: David C. <dc...@us...> - 2005-09-22 00:50:07
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4177/src/org/rubypeople/rdt/internal/launching Modified Files: RubyInterpreter.java Log Message: Changed exec to use alternate exec call. Index: RubyInterpreter.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RubyInterpreter.java 21 Sep 2005 21:00:17 -0000 1.9 --- RubyInterpreter.java 22 Sep 2005 00:49:57 -0000 1.10 *************** *** 4,7 **** --- 4,10 ---- import java.io.IOException; import java.text.MessageFormat; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.List; import org.eclipse.core.runtime.CoreException; *************** *** 48,60 **** // return Runtime.getRuntime().exec(this.getCommand() + " " + arguments, null, workingDirectory); //} ! public Process exec(String commandLine, File workingDirectory) throws CoreException { try { ! RdtLaunchingPlugin.debug("Launching: " + commandLine) ; RdtLaunchingPlugin.debug("Working Dir: " + workingDirectory) ; ! return Runtime.getRuntime().exec(this.getCommand() + " " + commandLine, null, workingDirectory); } catch (IOException e) { ! throw new RuntimeException("Unable to execute interpreter: " + commandLine + workingDirectory); } catch (IllegalCommandException ex) { --- 51,72 ---- // return Runtime.getRuntime().exec(this.getCommand() + " " + arguments, null, workingDirectory); //} + + public Process exec(String arguments, File workingDirectory) throws CoreException { + List argList = Arrays.asList(arguments.split("\\s+")); + return exec(argList, workingDirectory); + } + ! public Process exec(List args, File workingDirectory) throws CoreException { try { ! RdtLaunchingPlugin.debug("Launching: " + args) ; RdtLaunchingPlugin.debug("Working Dir: " + workingDirectory) ; ! List rubyCmd = new ArrayList(); ! rubyCmd.add(this.getCommand()); ! rubyCmd.addAll(args); ! return Runtime.getRuntime().exec((String[]) rubyCmd.toArray(new String[0]), null, workingDirectory); } catch (IOException e) { ! throw new RuntimeException("Unable to execute interpreter: " + args + workingDirectory); } catch (IllegalCommandException ex) { |