|
From: <caw...@us...> - 2007-03-26 13:33:16
|
Revision: 2222
http://svn.sourceforge.net/rubyeclipse/?rev=2222&view=rev
Author: cawilliams
Date: 2007-03-26 05:37:45 -0700 (Mon, 26 Mar 2007)
Log Message:
-----------
Apply Marcin's patch for Ticket #216. This is more of a temporary fix to allow JRuby. Ideally we should define an entirely new VM Type specxifically for JRuby.
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-03-26 01:47:16 UTC (rev 2221)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-03-26 12:37:45 UTC (rev 2222)
@@ -38,10 +38,10 @@
private static final char fgSeparator = File.separatorChar;
/**
- * The list of locations in which to look for the java executable in candidate
+ * The list of locations in which to look for the ruby executable in candidate
* VM install locations, relative to the VM install location.
*/
- private static final String[] fgCandidateRubyFiles = {"rubyw", "rubyw.exe", "ruby", "ruby.exe"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ private static final String[] fgCandidateRubyFiles = {"rubyw", "rubyw.exe", "ruby", "ruby.exe", "jrubyw", "jrubyw.bat", "jruby", "jruby.bat"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
private static final String[] fgCandidateRubyLocations = {"", "bin" + fgSeparator}; //$NON-NLS-1$ //$NON-NLS-2$
@@ -200,6 +200,7 @@
}
if (lines.size() > 0) {
String version = lines.remove(0);
+ removeNotExistingLibs(lines);
if (lines.size() > 0) {
String[] loadpath = lines.toArray(new String[lines.size()]);
return new LibraryInfo(version, loadpath);
@@ -209,6 +210,20 @@
}
/**
+ * Do not consider libraries which does not exist.
+ * @param libraries
+ */
+ private void removeNotExistingLibs(List<String> libraries) {
+ List<String> toRemove = new ArrayList<String>();
+ for (String path : libraries) {
+ File file = new File(path);
+ if (!file.exists())
+ toRemove.add(path);
+ }
+ libraries.removeAll(toRemove);
+ }
+
+ /**
* Returns default library info for the given install location.
*
* @param installLocation
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|