|
From: <caw...@us...> - 2007-08-20 16:02:41
|
Revision: 3010
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3010&view=rev
Author: cawilliams
Date: 2007-08-20 09:02:39 -0700 (Mon, 20 Aug 2007)
Log Message:
-----------
if we can't get path ro ruby on windows, just try C:\ruby. If we can't get path to ruby on *nix/Mac, or we got "/usr/bin" try /usr/local and then /opt/local
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-08-20 13:55:35 UTC (rev 3009)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-08-20 16:02:39 UTC (rev 3010)
@@ -267,6 +267,9 @@
break;
}
}
+ if (rubyExecutable == null) { // if all else fails, just try "C:/ruby"
+ rubyExecutable = new File("C:" + File.separator + "ruby" + File.separator + "bin" + File.separator + "ruby.exe");
+ }
} else { // Mac, Linux - so let's just run 'which ruby' and parse out the result
String[] cmdLine = new String[] { "which", "ruby" }; //$NON-NLS-1$ //$NON-NLS-2$
Process p = null;
@@ -293,10 +296,14 @@
p.destroy();
}
}
- // If we find one at /usr/bin/ruby, try to see if there's one at /usr/local/bin/ruby. If so, then prefer that.
- if (rubyExecutable != null && rubyExecutable.getAbsolutePath().startsWith("/usr/bin")) {
+ // If we don;t find ruby, or we find one at /usr/bin/ruby:
+ // try to see if there's one at /usr/local or /opt/local. If so, then prefer one of those.
+ if (rubyExecutable == null || rubyExecutable.getAbsolutePath().startsWith("/usr/bin")) {
File rubyHome = tryLocation(new File("/usr/local/bin/ruby"));
if (rubyHome != null) return rubyHome;
+
+ rubyHome = tryLocation(new File("/opt/local/bin/ruby"));
+ if (rubyHome != null) return rubyHome;
}
}
return tryLocation(rubyExecutable);
@@ -307,7 +314,7 @@
return null;
}
- File bin= new File(rubyExecutable.getParent());
+ File bin = rubyExecutable.getParentFile();
if (!bin.exists()) return null;
File rubyHome = bin.getParentFile();
if (!rubyHome.exists()) return null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|