|
From: <caw...@us...> - 2007-09-14 21:30:50
|
Revision: 3186
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3186&view=rev
Author: cawilliams
Date: 2007-09-14 14:30:48 -0700 (Fri, 14 Sep 2007)
Log Message:
-----------
add a new JRuby VM Type, fix invocation of jruby.bat with -e args
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/plugin.xml
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallType.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVM.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVMRunner.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVMType.java
Modified: trunk/org.rubypeople.rdt.launching/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.launching/plugin.xml 2007-09-14 21:30:35 UTC (rev 3185)
+++ trunk/org.rubypeople.rdt.launching/plugin.xml 2007-09-14 21:30:48 UTC (rev 3186)
@@ -15,6 +15,9 @@
class="org.rubypeople.rdt.internal.launching.StandardVMType"
id="org.rubypeople.rdt.launching.StandardVMType">
</vmInstallType>
+ <vmInstallType
+ class="org.rubypeople.rdt.internal.launching.JRubyVMType"
+ id="org.rubypeople.rdt.launching.JRubyVMType"/>
</extension>
<extension
point="org.eclipse.debug.core.launchConfigurationTypes">
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVM.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVM.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVM.java 2007-09-14 21:30:48 UTC (rev 3186)
@@ -0,0 +1,21 @@
+package org.rubypeople.rdt.internal.launching;
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.rubypeople.rdt.launching.IVMInstallType;
+import org.rubypeople.rdt.launching.IVMRunner;
+
+public class JRubyVM extends StandardVM {
+
+ public JRubyVM(IVMInstallType type, String id) {
+ super(type, id);
+ }
+
+ @Override
+ public IVMRunner getVMRunner(String mode) {
+ if (ILaunchManager.RUN_MODE.equals(mode)) {
+ return new JRubyVMRunner(this);
+ }
+ return super.getVMRunner(mode);
+ }
+
+}
Property changes on: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVM.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVMRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVMRunner.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVMRunner.java 2007-09-14 21:30:48 UTC (rev 3186)
@@ -0,0 +1,28 @@
+package org.rubypeople.rdt.internal.launching;
+
+import java.util.List;
+
+import org.rubypeople.rdt.launching.IVMInstall;
+import org.rubypeople.rdt.launching.IVMRunner;
+
+public class JRubyVMRunner extends StandardVMRunner implements IVMRunner {
+
+ public JRubyVMRunner(IVMInstall vmInstance) {
+ super(vmInstance);
+ }
+
+ @Override
+ protected void addArguments(String[] args, List<String> v, boolean isVMArgs) {
+ if (args == null) {
+ return;
+ }
+ for (int i= 0; i < args.length; i++) {
+ if (isVMArgs && args[i].charAt(0) == '-') {
+ v.add("\"" + args[i] + " " + args[++i] + "\""); // FIXME Only do this if we're launching a .bat file?
+ } else {
+ v.add(args[i]);
+ }
+ }
+ }
+
+}
Property changes on: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVMRunner.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVMType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVMType.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVMType.java 2007-09-14 21:30:48 UTC (rev 3186)
@@ -0,0 +1,352 @@
+package org.rubypeople.rdt.internal.launching;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.StringReader;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.Launch;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.IStreamsProxy;
+import org.eclipse.osgi.service.environment.Constants;
+import org.rubypeople.rdt.launching.AbstractVMInstallType;
+import org.rubypeople.rdt.launching.IVMInstall;
+
+public class JRubyVMType extends AbstractVMInstallType {
+
+ /**
+ * Map of the install path for which we were unable to generate
+ * the library info during this session.
+ */
+ private static Map<String, LibraryInfo> fgFailedInstallPath= new HashMap<String, LibraryInfo>();
+
+ /**
+ * Convenience handle to the system-specific file separator character
+ */
+ private static final char fgSeparator = File.separatorChar;
+
+ /**
+ * 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 = {"jrubyw", "jrubyw.bat", "jruby", "jruby.bat"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ private static final String[] fgCandidateRubyLocations = {"", "bin" + fgSeparator}; //$NON-NLS-1$ //$NON-NLS-2$
+
+
+ @Override
+ protected IVMInstall doCreateVMInstall(String id) {
+ return new JRubyVM(this, id);
+ }
+
+ public File detectInstallLocation() {
+ File rubyExecutable = null;
+ if (Platform.getOS().equals(Constants.OS_WIN32)) {
+ String winPath = System.getenv("Path"); // iterate through system path and try to find jruby.bat
+ String[] paths = winPath.split(";");
+ for (int i = 0; i < paths.length; i++) {
+ String possibleExecutablePath = paths[i] + File.separator + "jruby.bat";
+ File possible = new File(possibleExecutablePath);
+ if (possible.exists()) {
+ rubyExecutable = possible;
+ break;
+ }
+ }
+ } else { // Mac, Linux - so let's just run 'which jruby' and parse out the result
+ String[] cmdLine = new String[] { "which", "jruby" }; //$NON-NLS-1$ //$NON-NLS-2$
+ Process p = null;
+ try {
+ p = Runtime.getRuntime().exec(cmdLine);
+ IProcess process = DebugPlugin.newProcess(new Launch(null,
+ ILaunchManager.RUN_MODE, null), p,
+ "JRuby VM Install Detection"); //$NON-NLS-1$
+ for (int i = 0; i < 200; i++) {
+ // Wait no more than 10 seconds (200 * 50 mils)
+ if (process.isTerminated()) {
+ break;
+ }
+ try {
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ }
+ }
+ rubyExecutable = parseRubyExecutableLocation(process);
+ } catch (IOException ioe) {
+ LaunchingPlugin.log(ioe);
+ } finally {
+ if (p != null) {
+ p.destroy();
+ }
+ }
+ // 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/jruby"));
+ if (rubyHome != null) return rubyHome;
+
+ rubyHome = tryLocation(new File("/opt/local/bin/jruby"));
+ if (rubyHome != null) return rubyHome;
+ }
+ }
+ return tryLocation(rubyExecutable);
+ }
+
+ private File tryLocation(File rubyExecutable) {
+ if (rubyExecutable == null) {
+ return null;
+ }
+
+ File bin = rubyExecutable.getParentFile();
+ if (!bin.exists()) return null;
+ File rubyHome = bin.getParentFile();
+ if (!rubyHome.exists()) return null;
+ if (!canDetectDefaultSystemLibraries(rubyHome, rubyExecutable)) {
+ return null;
+ }
+
+ return rubyHome;
+ }
+
+ public IPath[] getDefaultLibraryLocations(File installLocation) {
+ File rubyExecutable = findRubyExecutable(installLocation);
+ LibraryInfo info;
+ if (rubyExecutable == null) {
+ info = getDefaultLibraryInfo(installLocation);
+ } else {
+ info = getLibraryInfo(installLocation, rubyExecutable);
+ }
+ String[] loadpath = info.getBootpath();
+ IPath[] paths = new IPath[loadpath.length];
+ for (int i = 0; i < loadpath.length; i++) {
+ paths[i] = new Path(loadpath[i]);
+ }
+ return paths;
+ }
+
+ public String getName() {
+ return "JRuby VM";
+ }
+
+ public IStatus validateInstallLocation(File rubyHome) {
+ IStatus status = null;
+ File rubyExecutable = findRubyExecutable(rubyHome);
+ if (rubyExecutable == null) {
+ status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_Not_a_JDK_Root__Java_executable_was_not_found_1, null);
+ } else {
+ if (canDetectDefaultSystemLibraries(rubyHome, rubyExecutable)) {
+ status = new Status(IStatus.OK, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_ok_2, null);
+ } else {
+ status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_Not_a_JDK_root__System_library_was_not_found__1, null);
+ }
+ }
+ return status;
+ }
+
+ /**
+ * Starting in the specified VM install location, attempt to find the 'jruby' executable
+ * file. If found, return the corresponding <code>File</code> object, otherwise return
+ * <code>null</code>.
+ */
+ public static File findRubyExecutable(File vmInstallLocation) {
+ // Try each candidate in order. The first one found wins. Thus, the order
+ // of fgCandidateRubyLocations and fgCandidateRubyFiles is significant.
+ for (int i = 0; i < fgCandidateRubyFiles.length; i++) {
+ for (int j = 0; j < fgCandidateRubyLocations.length; j++) {
+ File rubyFile = new File(vmInstallLocation, fgCandidateRubyLocations[j] + fgCandidateRubyFiles[i]);
+ if (rubyFile.isFile()) { // FIXME Only check for .bat on win32 and others on other platforms
+ return rubyFile;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Parses the output from 'Standard Ruby VM Install Detector'.
+ */
+ protected File parseRubyExecutableLocation(IProcess process) {
+ IStreamsProxy streamsProxy = process.getStreamsProxy();
+ String text = null;
+ if (streamsProxy != null) {
+ text = streamsProxy.getOutputStreamMonitor().getContents();
+ }
+ BufferedReader reader = new BufferedReader(new StringReader(text));
+ List<String> lines = new ArrayList<String>();
+ try {
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ lines.add(line);
+ }
+ } catch (IOException e) {
+ LaunchingPlugin.log(e);
+ }
+ if (lines.size() > 0) {
+ String location = lines.remove(0);
+ File executable = new File(location);
+ if (executable.isFile() && executable.exists()) return executable;
+ }
+ return null;
+ }
+
+ /**
+ * Return <code>true</code> if the appropriate system libraries can be found for the
+ * specified ruby executable, <code>false</code> otherwise.
+ */
+ protected boolean canDetectDefaultSystemLibraries(File rubyHome, File rubyExecutable) {
+ IPath[] locations = getDefaultLibraryLocations(rubyHome);
+ return locations.length > 0;
+ }
+
+ /**
+ * Returns default library info for the given install location.
+ *
+ * @param installLocation
+ * @return LibraryInfo
+ */
+ protected LibraryInfo getDefaultLibraryInfo(File installLocation) {
+ IPath[] dflts = getDefaultSystemLibrary(installLocation);
+ String[] strings = new String[dflts.length];
+ for (int i = 0; i < dflts.length; i++) {
+ strings[i] = dflts[i].toOSString();
+ }
+ return new LibraryInfo("1.8.4", strings); //$NON-NLS-1$
+ }
+
+ /**
+ * Return an <code>IPath</code> corresponding to the single library file containing the
+ * standard Ruby classes for VMs version 1.8.x.
+ */
+ protected IPath[] getDefaultSystemLibrary(File rubyHome) {
+ String stdPath = rubyHome.getAbsolutePath() + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "1.8";
+ String sitePath = rubyHome.getAbsolutePath() + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "site_ruby" + fgSeparator + "1.8";
+ IPath[] paths = new IPath[2];
+ paths[0] = new Path(sitePath);
+ paths[1] = new Path(stdPath);
+ return paths;
+ }
+
+ /**
+ * Return library information corresponding to the specified install
+ * location. If the info does not exist, create it using the given Java
+ * executable.
+ */
+ protected synchronized LibraryInfo getLibraryInfo(File rubyHome, File rubyExecutable) {
+ // See if we already know the info for the requested VM. If not, generate it.
+ String installPath = rubyHome.getAbsolutePath();
+ LibraryInfo info = LaunchingPlugin.getLibraryInfo(installPath);
+ if (info == null) {
+ info= fgFailedInstallPath.get(installPath);
+ if (info == null) {
+ info = generateLibraryInfo(rubyHome, rubyExecutable);
+ if (info == null) {
+ info = getDefaultLibraryInfo(rubyHome);
+ fgFailedInstallPath.put(installPath, info);
+ } else {
+ LaunchingPlugin.setLibraryInfo(installPath, info);
+ }
+ }
+ }
+ return info;
+ }
+
+ private LibraryInfo generateLibraryInfo(File rubyHome, File rubyExecutable) {
+ LibraryInfo info = null;
+ //locate the script to grab us our loadpaths
+ File file = LaunchingPlugin.getFileInPlugin(new Path("ruby").append("standard_vm_type").append("loadpath.rb")); //$NON-NLS-1$
+ if (file.exists()) {
+ String rubyExecutablePath = rubyExecutable.getAbsolutePath();
+ String[] cmdLine = new String[] {rubyExecutablePath, file.getAbsolutePath()}; //$NON-NLS-1$
+ Process p = null;
+ try {
+ p = Runtime.getRuntime().exec(cmdLine);
+ IProcess process = DebugPlugin.newProcess(new Launch(null, ILaunchManager.RUN_MODE, null), p, "Library Detection"); //$NON-NLS-1$
+ for (int i= 0; i < 200; i++) {
+ // Wait no more than 10 seconds (200 * 50 mils)
+ if (process.isTerminated()) {
+ break;
+ }
+ try {
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ }
+ }
+ info = parseLibraryInfo(process);
+ } catch (IOException ioe) {
+ LaunchingPlugin.log(ioe);
+ } finally {
+ if (p != null) {
+ p.destroy();
+ }
+ }
+ }
+ if (info == null) {
+ // log error that we were unable to generate library info - see bug 70011
+ LaunchingPlugin.log(MessageFormat.format("Failed to retrieve default libraries for {0}", rubyHome.getAbsolutePath())); //$NON-NLS-1$
+ }
+ return info;
+ }
+
+ /**
+ * Parses the output from 'LibraryDetector'.
+ */
+ protected LibraryInfo parseLibraryInfo(IProcess process) {
+ IStreamsProxy streamsProxy = process.getStreamsProxy();
+ String text = null;
+ if (streamsProxy != null) {
+ text = streamsProxy.getOutputStreamMonitor().getContents();
+ }
+ BufferedReader reader = new BufferedReader(new StringReader(text));
+ List<String> lines = new ArrayList<String>();
+ try {
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ lines.add(line);
+ }
+ } catch (IOException e) {
+ LaunchingPlugin.log(e);
+ }
+ 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);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * 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);
+ }
+
+ public File findExecutable(File installLocation) {
+ return findRubyExecutable(installLocation);
+ }
+
+ public String getVMVersion(File installLocation, File executable) {
+ LibraryInfo info = getLibraryInfo(installLocation, executable);
+ return info.getVersion();
+ }
+}
Property changes on: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/JRubyVMType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-09-14 21:30:35 UTC (rev 3185)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java 2007-09-14 21:30:48 UTC (rev 3186)
@@ -18,11 +18,6 @@
public class StandardVM extends AbstractVMInstall {
- /**
- * Convenience handle to the system-specific file separator character
- */
- private static final char fgSeparator = File.separatorChar;
-
public StandardVM(IVMInstallType type, String id) {
super(type, id);
}
@@ -45,10 +40,10 @@
}
public String getRubyVersion() {
- StandardVMType installType = (StandardVMType) getVMInstallType();
+ IVMInstallType installType = getVMInstallType();
File installLocation = getInstallLocation();
if (installLocation != null) {
- File executable = StandardVMType.findRubyExecutable(installLocation);
+ File executable = installType.findExecutable(installLocation);
if (executable != null) {
String vmVersion = installType.getVMVersion(installLocation, executable);
// strip off extra info
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-09-14 21:30:35 UTC (rev 3185)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-09-14 21:30:48 UTC (rev 3186)
@@ -28,6 +28,8 @@
public class StandardVMDebugger extends StandardVMRunner implements IVMRunner {
+ private boolean isVMArgs = true;
+
public StandardVMDebugger(IVMInstall vmInstance) {
super(vmInstance);
}
@@ -71,7 +73,7 @@
// options like '-client' & '-server' which are required to be the first
// options
String[] allVMArgs = combineVmArgs(config, fVMInstance);
- addArguments(allVMArgs, arguments);
+ addArguments(allVMArgs, arguments, isVMArgs );
String[] cp = config.getLoadPath();
if (cp.length > 0) {
@@ -85,7 +87,7 @@
arguments.addAll(debugArgs(debugTarget));
arguments.add(config.getFileToLaunch());
- addArguments(config.getProgramArguments(), arguments);
+ addArguments(config.getProgramArguments(), arguments, !isVMArgs);
String[] cmdLine = new String[arguments.size()];
arguments.toArray(cmdLine);
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-09-14 21:30:35 UTC (rev 3185)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-09-14 21:30:48 UTC (rev 3186)
@@ -39,6 +39,7 @@
protected static final String END_OF_OPTIONS_DELIMITER = "--";
protected IVMInstall fVMInstance;
+ private boolean isVMArgs = true;
public StandardVMRunner(IVMInstall vmInstance) {
fVMInstance= vmInstance;
@@ -84,7 +85,7 @@
return buf.toString();
}
- protected void addArguments(String[] args, List<String> v) {
+ protected void addArguments(String[] args, List<String> v, boolean isVMArgs) {
if (args == null) {
return;
}
@@ -144,7 +145,7 @@
// If no ruby command was specified, use default executable
if (command == null) {
- File exe = StandardVMType.findRubyExecutable(fVMInstance.getInstallLocation());
+ File exe = fVMInstance.getVMInstallType().findExecutable(fVMInstance.getInstallLocation());
if (exe == null) {
abort(MessageFormat.format(LaunchingMessages.StandardVMRunner_Unable_to_locate_executable_for__0__1, fVMInstance.getName()), null, IRubyLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
}
@@ -226,7 +227,7 @@
// VM args are the first thing after the ruby program so that users can specify
// options like '-client' & '-server' which are required to be the first option
String[] allVMArgs = combineVmArgs(config, fVMInstance);
- addArguments(allVMArgs, arguments);
+ addArguments(allVMArgs, arguments, isVMArgs );
String[] lp= config.getLoadPath();
if (lp.length > 0) {
@@ -238,7 +239,7 @@
arguments.add(config.getFileToLaunch());
String[] programArgs= config.getProgramArguments();
- addArguments(programArgs, arguments);
+ addArguments(programArgs, arguments, !isVMArgs);
String[] cmdLine= new String[arguments.size()];
arguments.toArray(cmdLine);
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-09-14 21:30:35 UTC (rev 3185)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-09-14 21:30:48 UTC (rev 3186)
@@ -41,7 +41,7 @@
* 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", "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[] fgCandidateRubyFiles = {"rubyw", "rubyw.exe", "ruby", "ruby.exe"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
private static final String[] fgCandidateRubyLocations = {"", "bin" + fgSeparator}; //$NON-NLS-1$ //$NON-NLS-2$
@@ -351,5 +351,9 @@
}
return null;
}
+
+ public File findExecutable(File installLocation) {
+ return findRubyExecutable(installLocation);
+ }
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallType.java 2007-09-14 21:30:35 UTC (rev 3185)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallType.java 2007-09-14 21:30:48 UTC (rev 3186)
@@ -107,4 +107,8 @@
*/
public File detectInstallLocation();
+ File findExecutable(File installLocation);
+
+ String getVMVersion(File installLocation, File executable);
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|