Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8087/src/org/rubypeople/rdt/internal/launching Modified Files: RubyInterpreter.java InterpreterRunner.java DebuggerRunner.java InterpreterRunnerConfiguration.java Log Message: Converted all 'launchers' to list-based command line construction. Index: InterpreterRunner.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunner.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** InterpreterRunner.java 21 Sep 2005 21:00:17 -0000 1.15 --- InterpreterRunner.java 25 Sep 2005 17:57:01 -0000 1.16 *************** *** 2,6 **** --- 2,8 ---- import java.io.File; + import java.util.ArrayList; import java.util.HashMap; + import java.util.List; import java.util.Map; *************** *** 15,19 **** public IProcess run(InterpreterRunnerConfiguration configuration, ILaunch launch) throws CoreException { ! String commandLine = renderCommandLine(configuration); File workingDirectory = configuration.getAbsoluteWorkingDirectory(); --- 17,21 ---- public IProcess run(InterpreterRunnerConfiguration configuration, ILaunch launch) throws CoreException { ! List commandLine = renderCommandLine(configuration); File workingDirectory = configuration.getAbsoluteWorkingDirectory(); *************** *** 23,27 **** defaultAttributes.put(IProcess.ATTR_PROCESS_TYPE, "ruby"); IProcess process = DebugPlugin.newProcess(launch, nativeRubyProcess, renderLabel(configuration), defaultAttributes); ! process.setAttribute(RdtLaunchingPlugin.PLUGIN_ID + ".launcher.cmdline", commandLine); return process ; } --- 25,29 ---- defaultAttributes.put(IProcess.ATTR_PROCESS_TYPE, "ruby"); IProcess process = DebugPlugin.newProcess(launch, nativeRubyProcess, renderLabel(configuration), defaultAttributes); ! process.setAttribute(RdtLaunchingPlugin.PLUGIN_ID + ".launcher.cmdline", commandLine.toString()); return process ; } *************** *** 45,66 **** } ! protected String renderCommandLine(InterpreterRunnerConfiguration configuration) { RubyInterpreter interpreter = configuration.getInterpreter(); ! StringBuffer buffer = new StringBuffer(); ! buffer.append(this.getDebugCommandLineArgument()); ! buffer.append(configuration.renderLoadPath()); ! buffer.append(" " + configuration.getInterpreterArguments()); ! buffer.append(interpreter.endOfOptionsDelimeter); ! buffer.append(RdtLaunchingPlugin.osDependentPath(configuration.getAbsoluteFileName())); ! buffer.append(" " + configuration.getProgramArguments()); ! return buffer.toString(); } ! ! protected String getDebugCommandLineArgument() { ! return "" ; } --- 47,66 ---- } ! private List renderCommandLine(InterpreterRunnerConfiguration configuration) { ! List commandLine = new ArrayList(); RubyInterpreter interpreter = configuration.getInterpreter(); ! addDebugCommandLineArgument(commandLine); ! commandLine.addAll(configuration.renderLoadPath()); ! commandLine.addAll(ArgumentSplitter.split(configuration.getInterpreterArguments())); ! commandLine.add(RubyInterpreter.END_OF_OPTIONS_DELIMITER); ! commandLine.add(RdtLaunchingPlugin.osDependentPath(configuration.getAbsoluteFileName())); ! commandLine.addAll(ArgumentSplitter.split(configuration.getProgramArguments())); ! return commandLine; } ! protected void addDebugCommandLineArgument(List commandLine) { } Index: DebuggerRunner.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DebuggerRunner.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** DebuggerRunner.java 5 Mar 2005 15:13:34 -0000 1.18 --- DebuggerRunner.java 25 Sep 2005 17:57:01 -0000 1.19 *************** *** 2,5 **** --- 2,6 ---- import java.io.File; + import java.util.List; import org.eclipse.core.runtime.CoreException; *************** *** 30,39 **** } ! protected String getDebugCommandLineArgument() { ! String debugLoadPathAddition = RdtLaunchingPlugin.osDependentPath(DebuggerRunner.getDirectoryOfRubyDebuggerFile().replace('/', File.separatorChar)); if (RdtDebugCorePlugin.isRubyDebuggerVerbose()) { ! return " -reclipseDebugVerbose -I " + debugLoadPathAddition ; } ! return " -reclipseDebug -I "+ debugLoadPathAddition ; } --- 31,43 ---- } ! protected void addDebugCommandLineArgument(List commandLine) { if (RdtDebugCorePlugin.isRubyDebuggerVerbose()) { ! commandLine.add("-reclipseDebugVerbose"); ! } else { ! commandLine.add("-reclipseDebug"); } ! ! commandLine.add("-I"); ! commandLine.add(RdtLaunchingPlugin.osDependentPath(DebuggerRunner.getDirectoryOfRubyDebuggerFile().replace('/', File.separatorChar))); } Index: RubyInterpreter.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** RubyInterpreter.java 24 Sep 2005 20:19:41 -0000 1.12 --- RubyInterpreter.java 25 Sep 2005 17:57:01 -0000 1.13 *************** *** 13,17 **** public class RubyInterpreter { ! public final String endOfOptionsDelimeter = " -- "; protected IPath installLocation; --- 13,17 ---- public class RubyInterpreter { ! public static final String END_OF_OPTIONS_DELIMITER = "--"; protected IPath installLocation; *************** *** 47,55 **** } - public Process exec(String arguments, File workingDirectory) throws CoreException { - return exec(ArgumentSplitter.split(arguments), workingDirectory); - } - - public Process exec(List args, File workingDirectory) throws CoreException { --- 47,50 ---- Index: InterpreterRunnerConfiguration.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** InterpreterRunnerConfiguration.java 29 Aug 2005 16:06:44 -0000 1.12 --- InterpreterRunnerConfiguration.java 25 Sep 2005 17:57:01 -0000 1.13 *************** *** 2,6 **** --- 2,8 ---- import java.io.File; + import java.util.ArrayList; import java.util.Iterator; + import java.util.List; import org.eclipse.core.resources.IProject; *************** *** 96,109 **** } ! protected void addToLoadPath(StringBuffer loadPath, IProject project) { if (!project.isAccessible()) { return ; } ! loadPath.append(" -I " + RdtLaunchingPlugin.osDependentPath(project.getLocation().toOSString())); } - - protected String renderLoadPath() { - StringBuffer loadPath = new StringBuffer(); RubyProject project = this.getProject(); addToLoadPath(loadPath, project.getProject()); --- 98,115 ---- } ! protected void addToLoadPath(List loadPath, IProject project) { if (!project.isAccessible()) { return ; } ! addToLoadPath(loadPath, project.getLocation().toOSString()); } + private void addToLoadPath(List loadPath, String pathDirectory) { + loadPath.add("-I"); + loadPath.add(RdtLaunchingPlugin.osDependentPath(pathDirectory)); + } + + protected List renderLoadPath() { + List loadPath = new ArrayList(); RubyProject project = this.getProject(); addToLoadPath(loadPath, project.getProject()); *************** *** 114,120 **** } if (new Path(this.getFileName()).segmentCount() > 1) { ; ! loadPath.append(" -I " + RdtLaunchingPlugin.osDependentPath(this.getAbsoluteFileDirectory())) ; } ! return loadPath.toString(); } } --- 120,126 ---- } if (new Path(this.getFileName()).segmentCount() > 1) { ; ! addToLoadPath(loadPath, this.getAbsoluteFileDirectory()); } ! return loadPath; } } |