|
From: <caw...@us...> - 2007-04-26 13:11:19
|
Revision: 2373
http://svn.sourceforge.net/rubyeclipse/?rev=2373&view=rev
Author: cawilliams
Date: 2007-04-26 06:11:18 -0700 (Thu, 26 Apr 2007)
Log Message:
-----------
grab root of ruby install from executable, not path to bin folder...
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-04-26 11:23:58 UTC (rev 2372)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-04-26 13:11:18 UTC (rev 2373)
@@ -28,7 +28,6 @@
import javax.xml.transform.TransformerException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMInstall2;
import org.rubypeople.rdt.launching.IVMInstallType;
@@ -405,7 +404,10 @@
File installLocation= new File(installPath);
// If the path is to the executable (which it should be), chop off last part of path!
if (installLocation.isFile()) {
- installLocation = installLocation.getParentFile();
+ installLocation = installLocation.getParentFile(); // move up to "bin"
+ if (installLocation != null && installLocation.getParentFile() != null) {
+ installLocation = installLocation.getParentFile(); // this should now be ruby install location
+ }
}
vmStandin.setInstallLocation(installLocation);
container.addVM(vmStandin);
@@ -415,36 +417,6 @@
}
/**
- * Create & return a LibraryLocation object populated from the attribute values
- * in the specified node.
- */
- private static IPath getLibraryLocation(Element libLocationElement) {
- String src= libLocationElement.getAttribute("src"); //$NON-NLS-1$
- return new Path(src);
- }
-
- /**
- * Set the LibraryLocations on the specified VM, by extracting the subordinate
- * nodes from the specified 'lirbaryLocations' node.
- */
- private static void setLibraryLocations(IVMInstall vm, Element libLocationsElement) {
- NodeList list = libLocationsElement.getChildNodes();
- int length = list.getLength();
- List<IPath> locations = new ArrayList<IPath>(length);
- for (int i = 0; i < length; ++i) {
- Node node = list.item(i);
- short type = node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- Element libraryLocationElement= (Element)node;
- if (libraryLocationElement.getNodeName().equals("libraryLocation")) { //$NON-NLS-1$
- locations.add(getLibraryLocation(libraryLocationElement));
- }
- }
- }
- vm.setLibraryLocations(locations.toArray(new IPath[locations.size()]));
- }
-
- /**
* Removes the VM from this container.
*
* @param vm vm intall
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|