|
From: Markus B. <mba...@us...> - 2005-09-21 21:00:26
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20768/src/org/rubypeople/rdt/internal/launching Modified Files: RubyInterpreter.java InterpreterRunner.java Log Message: reuse RubyInterpreter for execute ruby command for ri Index: InterpreterRunner.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunner.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** InterpreterRunner.java 5 Mar 2005 15:13:34 -0000 1.14 --- InterpreterRunner.java 21 Sep 2005 21:00:17 -0000 1.15 *************** *** 2,12 **** import java.io.File; - import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.CoreException; - import org.eclipse.core.runtime.IStatus; - import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunch; --- 2,9 ---- *************** *** 21,36 **** File workingDirectory = configuration.getAbsoluteWorkingDirectory(); ! Process nativeRubyProcess = null; ! try { ! RdtLaunchingPlugin.debug("Launching: " + commandLine) ; ! RdtLaunchingPlugin.debug("Working Dir: " + workingDirectory) ; ! nativeRubyProcess = configuration.getInterpreter().exec(commandLine, workingDirectory); ! } catch (IOException e) { ! throw new RuntimeException("Unable to execute interpreter: " + commandLine + workingDirectory); ! } ! catch (IllegalCommandException ex) { ! IStatus errorStatus = new Status(IStatus.ERROR, RdtLaunchingPlugin.PLUGIN_ID, IStatus.OK, ex.getMessage(), null); ! throw new CoreException(errorStatus) ; ! } Map defaultAttributes = new HashMap(); defaultAttributes.put(IProcess.ATTR_PROCESS_TYPE, "ruby"); --- 18,23 ---- File workingDirectory = configuration.getAbsoluteWorkingDirectory(); ! RubyInterpreter interpreter = configuration.getInterpreter() ; ! Process nativeRubyProcess = interpreter.exec(commandLine, workingDirectory); Map defaultAttributes = new HashMap(); defaultAttributes.put(IProcess.ATTR_PROCESS_TYPE, "ruby"); *************** *** 40,43 **** --- 27,32 ---- } + + protected String renderLabel(InterpreterRunnerConfiguration configuration) { StringBuffer buffer = new StringBuffer(); Index: RubyInterpreter.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RubyInterpreter.java 5 Mar 2005 15:13:34 -0000 1.8 --- RubyInterpreter.java 21 Sep 2005 21:00:17 -0000 1.9 *************** *** 5,9 **** --- 5,12 ---- import java.text.MessageFormat; + import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; + import org.eclipse.core.runtime.IStatus; + import org.eclipse.core.runtime.Status; public class RubyInterpreter { *************** *** 42,47 **** } ! public Process exec(String arguments, File workingDirectory) throws IOException, IllegalCommandException { ! return Runtime.getRuntime().exec(this.getCommand() + " " + arguments, null, workingDirectory); } --- 45,66 ---- } ! //public Process exec(String arguments, File workingDirectory) throws IOException, IllegalCommandException { ! // 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) { ! IStatus errorStatus = new Status(IStatus.ERROR, RdtLaunchingPlugin.PLUGIN_ID, IStatus.OK, ex.getMessage(), null); ! throw new CoreException(errorStatus) ; ! } ! } |