|
From: <caw...@us...> - 2007-04-30 14:09:45
|
Revision: 2397
http://svn.sourceforge.net/rubyeclipse/?rev=2397&view=rev
Author: cawilliams
Date: 2007-04-30 07:09:45 -0700 (Mon, 30 Apr 2007)
Log Message:
-----------
add methods to grab RI or RDoc locations (based on default VM install location)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-04-30 14:08:47 UTC (rev 2396)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-04-30 14:09:45 UTC (rev 2397)
@@ -1657,4 +1657,23 @@
notifyDefaultVMChanged(previous, current);
}
}
+
+ public static File getRI() {
+ return getBinExecutable("ri");
+ }
+
+ public static File getRDoc() {
+ return getBinExecutable("rdoc");
+ }
+
+ private static File getBinExecutable(String command) {
+ IVMInstall vm = RubyRuntime.getDefaultVMInstall();
+ if (vm == null) return null;
+ File installLocation = vm.getInstallLocation();
+ String path = installLocation.getAbsolutePath() + File.separator + "bin" + File.separator + command;
+ if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ path += ".bat";
+ }
+ return new File(path);
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|