|
From: <caw...@us...> - 2007-02-23 18:44:07
|
Revision: 2016
http://svn.sourceforge.net/rubyeclipse/?rev=2016&view=rev
Author: cawilliams
Date: 2007-02-23 10:44:06 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
hopefully make this work cross-platform
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java 2007-02-23 18:33:32 UTC (rev 2015)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java 2007-02-23 18:44:06 UTC (rev 2016)
@@ -133,15 +133,15 @@
private IPath generateCoreStubs(File rubyExecutable) {
if (rubyExecutable == null) return null;
//locate the script to generate our core stubs
- File file = LaunchingPlugin.getFileInPlugin(new Path("ruby/core_stubber.rb")); //$NON-NLS-1$
- if (file.exists()) {
- IPath path = new Path(file.getParentFile().getAbsolutePath() + fgSeparator + getId() + fgSeparator + "lib"); //$NON-NLS-1$
- if (path.toFile().exists()) {
- return path; // we've already created the stubs for this VM
+ File coreStubber = LaunchingPlugin.getFileInPlugin(new Path("ruby" + fgSeparator + "core_stubber.rb")); //$NON-NLS-1$ //$NON-NLS-2$
+ if (coreStubber.exists()) {
+ IPath stubFolder = new Path(coreStubber.getParentFile().getAbsolutePath() + fgSeparator + getId() + fgSeparator + "lib"); //$NON-NLS-1$
+ if (stubFolder.toFile().exists()) {
+ return stubFolder; // we've already created the stubs for this VM
}
- path.toFile().mkdirs(); // Make the directory structure to throw the files into
+ stubFolder.toFile().mkdirs(); // Make the directory structure to throw the files into
String rubyExecutablePath = rubyExecutable.getAbsolutePath();
- String[] cmdLine = new String[] {rubyExecutablePath, file.getAbsolutePath(), path.toOSString()};
+ String[] cmdLine = new String[] {rubyExecutablePath, coreStubber.getAbsolutePath(), stubFolder.toOSString()};
Process p = null;
try {
p = Runtime.getRuntime().exec(cmdLine);
@@ -156,7 +156,7 @@
} catch (InterruptedException e) {
}
}
- return path;
+ return stubFolder;
} catch (IOException ioe) {
LaunchingPlugin.log(ioe);
} finally {
Modified: trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-02-23 18:33:32 UTC (rev 2015)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-02-23 18:44:06 UTC (rev 2016)
@@ -51,25 +51,29 @@
}
public void testGetInstalledInterpreters() {
+ String vmOneName = "InterpreterOne";
+ String vmOneId = vmOneName;
+ String vmTwoName = "InterpreterTwo";
+ String vmTwoId = vmTwoName;
try {
- VMStandin standin = new VMStandin(vmType, "InterpreterOne");
+ VMStandin standin = new VMStandin(vmType, vmOneId);
standin.setInstallLocation(new File("C:/RubyInstallRootOne"));
- standin.setName("InterpreterOne");
+ standin.setName(vmOneName);
standin.convertToRealVM();
- VMStandin standin2 = new VMStandin(vmType, "InterpreterTwo");
+ VMStandin standin2 = new VMStandin(vmType, vmTwoId);
standin2.setInstallLocation(new File("C:/RubyInstallRootTwo"));
- standin2.setName("InterpreterTwo");
+ standin2.setName(vmTwoName);
standin2.convertToRealVM();
IVMInstallType myType = RubyRuntime.getVMInstallType(VM_TYPE_ID);
IVMInstall[] installs = myType.getVMInstalls();
assertEquals(2, installs.length);
- assertEquals("InterpreterOne", installs[0].getName());
- assertEquals("InterpreterTwo", installs[1].getName());
+ assertEquals(vmOneName, installs[0].getName());
+ assertEquals(vmTwoName, installs[1].getName());
} finally {
- vmType.disposeVMInstall("InterpreterOne");
- vmType.disposeVMInstall("InterpreterTwo");
+ vmType.disposeVMInstall(vmOneId);
+ vmType.disposeVMInstall(vmTwoId);
}
}
@@ -86,7 +90,7 @@
RubyRuntime.setDefaultVMInstall(one, null,true);
IPath vmOneLocation = folderOne.getLocation();
assertEquals(
- "XML should indicate only one interpreter with it being the selected.",
+ "XML should indicate only one interpreter with it being the one selected.",
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
"<vmSettings defaultVM=\"43,org.rubypeople.rdt.launching.StandardVMType14," + vmOneId + "\">\r\n" +
"<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n" +
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|