|
From: <caw...@us...> - 2007-08-14 16:32:35
|
Revision: 2971
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2971&view=rev
Author: cawilliams
Date: 2007-08-14 09:32:32 -0700 (Tue, 14 Aug 2007)
Log Message:
-----------
first attempt to see if we can force some ruby launches to run under sudo (like the gem install comamnd needs to)
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-08-14 15:04:02 UTC (rev 2970)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-08-14 16:32:32 UTC (rev 2971)
@@ -349,7 +349,7 @@
if (!isRubyGemsInstalled()) return false;
try {
String command = UPDATE_COMMAND + " " + gem.getName();
- ILaunchConfiguration config = createGemLaunchConfiguration(command, true);
+ ILaunchConfiguration config = createGemLaunchConfiguration(command, false);
final ILaunch launch = config.launch(ILaunchManager.RUN_MODE, null);
Job job = new Job("Updating gem " + gem.getName()) {
@@ -380,7 +380,7 @@
return DebugPlugin.getDefault().getLaunchManager();
}
- private ILaunchConfiguration createGemLaunchConfiguration(String arguments, boolean interactive) {
+ private ILaunchConfiguration createGemLaunchConfiguration(String arguments, boolean isSudo) {
String gemPath = getGemScriptPath();
ILaunchConfiguration config = null;
try {
@@ -403,6 +403,7 @@
wc.setAttribute(
IRubyLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
"");
+ wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_IS_SUDO, isSudo);
Map<String, String> map = new HashMap<String, String>();
map.put(IRubyLaunchConfigurationConstants.ATTR_RUBY_COMMAND,
EXECUTABLE);
@@ -411,18 +412,7 @@
IRubyLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE_SPECIFIC_ATTRS_MAP,
map);
wc.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
- wc.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND,
- !interactive);
- if (!interactive) {
- wc.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE,
- false);
- IPath outFilePath = AptanaRDTPlugin.getDefault()
- .getStateLocation();
- outFilePath = outFilePath.append(System.currentTimeMillis()
- + ".txt");
- wc.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE,
- outFilePath.toPortableString());
- }
+ wc.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, false);
config = wc.doSave();
} catch (CoreException ce) {
// ignore for now
@@ -510,7 +500,7 @@
&& gem.getVersion().trim().length() > 0) {
command += " " + VERSION_SWITCH + " " + gem.getVersion();
}
- ILaunchConfiguration config = createGemLaunchConfiguration(command, true);
+ ILaunchConfiguration config = createGemLaunchConfiguration(command, false);
final ILaunch launch = config.launch(ILaunchManager.RUN_MODE, null);
Job job = new Job("Notifying gem listeners of uninstalled gem") {
@@ -647,7 +637,7 @@
public boolean updateAll() {
if (!isRubyGemsInstalled()) return false;
try {
- ILaunchConfiguration config = createGemLaunchConfiguration(UPDATE_COMMAND, true);
+ ILaunchConfiguration config = createGemLaunchConfiguration(UPDATE_COMMAND, false);
final ILaunch launch = config.launch(ILaunchManager.RUN_MODE, null);
Job job = new Job("Updating gem listing") {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|