You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(41) |
Apr
(9) |
May
|
Jun
|
Jul
(39) |
Aug
(38) |
Sep
(135) |
Oct
(220) |
Nov
(75) |
Dec
(74) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(44) |
Feb
(160) |
Mar
(49) |
Apr
(69) |
May
(40) |
Jun
(52) |
Jul
(47) |
Aug
(51) |
Sep
(19) |
Oct
(22) |
Nov
(36) |
Dec
(76) |
| 2007 |
Jan
(154) |
Feb
(165) |
Mar
(186) |
Apr
(143) |
May
(175) |
Jun
(133) |
Jul
(203) |
Aug
(177) |
Sep
(136) |
Oct
|
Nov
|
Dec
|
|
From: <caw...@us...> - 2007-07-27 19:33:56
|
Revision: 2897
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2897&view=rev
Author: cawilliams
Date: 2007-07-27 12:33:50 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
add open type in hierarchy command
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/plugin.xml
Modified: trunk/org.rubypeople.rdt.ui/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.ui/plugin.xml 2007-07-27 14:52:07 UTC (rev 2896)
+++ trunk/org.rubypeople.rdt.ui/plugin.xml 2007-07-27 19:33:50 UTC (rev 2897)
@@ -602,10 +602,10 @@
name="%OpenTypeAction.label">
</command>
<command
- name="%ActionDefinition.openTypeInHierarchy.name"
+ categoryId="org.eclipse.ui.category.navigate"
description="%ActionDefinition.openTypeInHierarchy.description"
- categoryId="org.eclipse.ui.category.navigate"
- id="org.rubypeople.rdt.ui.navigate.open.type.in.hierarchy">
+ id="org.rubypeople.rdt.ui.navigate.open.type.in.hierarchy"
+ name="%ActionDefinition.openTypeInHierarchy.name">
</command>
<command
name="%ActionDefinition.show.outline.name"
@@ -686,6 +686,11 @@
categoryId="org.eclipse.search.ui.category.search"
id="org.rubypeople.rdt.ui.edit.text.ruby.search.read.access.in.working.set">
</command>
+ <command
+ categoryId="org.eclipse.ui.category.navigate"
+ description="%ActionDefinition.openTypeHierarchy.description"
+ id="org.rubypeople.rdt.ui.edit.text.ruby.open.type.hierarchy"
+ name="%ActionDefinition.openTypeHierarchy.name"/>
</extension>
<extension
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-27 14:52:17
|
Revision: 2896
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2896&view=rev
Author: cawilliams
Date: 2007-07-27 07:52:07 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
don't add gems to command line loadpath!
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java 2007-07-26 20:26:48 UTC (rev 2895)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java 2007-07-27 14:52:07 UTC (rev 2896)
@@ -358,7 +358,7 @@
private void initializeLoadpathProperty() {
switch (getType()) {
case VARIABLE:
- if (getVariableName().equals(RubyRuntime.RUBYLIB_VARIABLE)) {
+ if (getVariableName().equals(RubyRuntime.RUBYLIB_VARIABLE) || getVariableName().equals("GEM_LIB")) {
setLoadpathProperty(STANDARD_CLASSES);
} else {
setLoadpathProperty(USER_CLASSES);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 20:26:49
|
Revision: 2895
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2895&view=rev
Author: cawilliams
Date: 2007-07-26 13:26:48 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
add some hacks in to support JRuby (if we pass along a command, try it and the prepend "j" and try that (so when we pass "ruby", if that executable doesn't exists, try "jruby")
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
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-07-26 20:13:39 UTC (rev 2894)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-07-26 20:26:48 UTC (rev 2895)
@@ -147,7 +147,7 @@
return string;
}
- // Build the path to the ruby executable. First try 'bin'
+ // Build the path to the ruby executable.
String installLocation = fVMInstance.getInstallLocation().getAbsolutePath() + File.separatorChar;
File exe = new File(installLocation + "bin" + File.separatorChar + command); //$NON-NLS-1$
if (fileExists(exe)){
@@ -159,6 +159,18 @@
string.add(exe.getAbsolutePath());
return string;
}
+ // HACK FIXME This is just to allow for jruby!
+ String path = installLocation + "bin" + File.separatorChar + "j" + command; //$NON-NLS-1$ //$NON-NLS-2$
+ exe = new File(path + ".bat"); //$NON-NLS-1$
+ if (fileExists(exe)){
+ string.add(exe.getAbsolutePath());
+ return string;
+ }
+ exe = new File(path);
+ if (fileExists(exe)){
+ string.add(exe.getAbsolutePath());
+ return string;
+ }
// not found
abort(MessageFormat.format(LaunchingMessages.StandardVMRunner_Specified_executable__0__does_not_exist_for__1__4, command, fVMInstance.getName()), null, IRubyLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 20:13:40
|
Revision: 2894
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2894&view=rev
Author: cawilliams
Date: 2007-07-26 13:13:39 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
remove the flush commands from vm arguments (since that is now coevered by sync.rb). Also when default vm changes, clear local gem list and local cache.
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-07-26 19:44:28 UTC (rev 2893)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-07-26 20:13:39 UTC (rev 2894)
@@ -69,8 +69,6 @@
private static final String UPDATE_COMMAND = "update";
private static final String EXECUTABLE = "ruby";
- private static final String VM_ARGS = "-e STDOUT.sync=true -e STDERR.sync=true -e load(ARGV.shift)";
-
private static final String REMOTE_GEMS_CACHE_FILE = "remote_gems.xml";
private static final String LOCAL_GEMS_CACHE_FILE = "local_gems.xml";
@@ -100,7 +98,9 @@
public void vmAdded(IVMInstall newVm) {}
public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {
- fGemInstallPath = null;
+ fGemInstallPath = null;
+ gems.clear();
+ storeGemCache(gems, getConfigFile(LOCAL_GEMS_CACHE_FILE));
}
});
@@ -398,7 +398,7 @@
arguments);
wc.setAttribute(
IRubyLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
- VM_ARGS);
+ "");
Map<String, String> map = new HashMap<String, String>();
map.put(IRubyLaunchConfigurationConstants.ATTR_RUBY_COMMAND,
EXECUTABLE);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 19:44:28
|
Revision: 2893
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2893&view=rev
Author: cawilliams
Date: 2007-07-26 12:44:28 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
add generate actions into source menu and generate group from RDT UI plugin
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/plugin.xml
Modified: trunk/org.rubypeople.rdt.refactoring/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/plugin.xml 2007-07-26 18:58:35 UTC (rev 2892)
+++ trunk/org.rubypeople.rdt.refactoring/plugin.xml 2007-07-26 19:44:28 UTC (rev 2893)
@@ -18,35 +18,7 @@
label="%rubyRefactoring.refactoringMenuLabel"
path="edit">
<separator name="org.rubypeople.rdt.refactoring.refactoringGroup"/>
- </menu>
- <menu
- id="org.rubypeople.rdt.refactoring.sourceMenu"
- label="%rubyRefactoring.sourceMenuLabel"
- path="edit">
- <separator name="org.rubypeople.rdt.refactoring.sourceGeneratorGroup"/>
- </menu>
-<!-- Source: -->
- <action
- class="org.rubypeople.rdt.refactoring.action.OverrideMethodAction"
- definitionId="org.rubypeople.rdt.refactoring.command.OverrideMethod"
- id="org.rubypeople.rdt.refactoring.overrideMethodAction"
- label="%rubyRefactoring.OverrideMethodLabel"
- menubarPath="org.rubypeople.rdt.refactoring.sourceMenu/org.rubypeople.rdt.refactoring.sourceGeneratorGroup"
- tooltip="Add Constructor from Superclass"/>
- <action
- class="org.rubypeople.rdt.refactoring.action.GenerateConstructorAction"
- definitionId="org.rubypeople.rdt.refactoring.command.GenerateConstructor"
- id="org.rubypeople.rdt.refactoring.generateConstructorAction"
- label="%rubyRefactoring.GenerateConstructorLabel"
- menubarPath="org.rubypeople.rdt.refactoring.sourceMenu/org.rubypeople.rdt.refactoring.sourceGeneratorGroup"
- tooltip="Generate Constructor"/>
- <action
- class="org.rubypeople.rdt.refactoring.action.GenerateAccessorsAction"
- definitionId="org.rubypeople.rdt.refactoring.command.GenerateAccessors"
- id="org.rubypeople.rdt.refactoring.generateaccessors"
- label="%rubyRefactoring.GenerateAccessorLabel"
- menubarPath="org.rubypeople.rdt.refactoring.sourceMenu/org.rubypeople.rdt.refactoring.sourceGeneratorGroup"
- tooltip="Generate Accessors"/>
+ </menu>
<!-- experimental
<action
class="org.rubypeople.rdt.refactoring.action.FormatSourceAction"
@@ -398,4 +370,42 @@
</enablement>
</changePreviewViewer>
</extension>
+<extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ id="org.rubypeople.rdt.ui.RefactoringActionSet"
+ label="org.rubypeople.rdt.ui.RefactoringActionSet"
+ visible="false">
+ <action
+ class="org.rubypeople.rdt.refactoring.action.GenerateConstructorAction"
+ definitionId="org.rubypeople.rdt.refactoring.command.GenerateConstructor"
+ id="org.rubypeople.rdt.refactoring.generateConstructorAction"
+ label="%rubyRefactoring.GenerateConstructorLabel"
+ menubarPath="org.rubypeople.rdt.ui.source.menu/generateGroup"
+ style="push"
+ tooltip="Generate Constructor"/>
+ <action
+ class="org.rubypeople.rdt.refactoring.action.GenerateAccessorsAction"
+ definitionId="org.rubypeople.rdt.refactoring.command.GenerateAccessors"
+ id="org.rubypeople.rdt.refactoring.generateaccessors"
+ label="%rubyRefactoring.GenerateAccessorLabel"
+ menubarPath="org.rubypeople.rdt.ui.source.menu/generateGroup"
+ style="push"
+ tooltip="Generate Accessors"/>
+ <action
+ class="org.rubypeople.rdt.refactoring.action.OverrideMethodAction"
+ definitionId="org.rubypeople.rdt.refactoring.command.OverrideMethod"
+ id="org.rubypeople.rdt.refactoring.overrideMethodAction"
+ label="%rubyRefactoring.OverrideMethodLabel"
+ menubarPath="org.rubypeople.rdt.ui.source.menu/generateGroup"
+ style="push"
+ tooltip="Add Constructor from Superclass"/>
+ </actionSet>
+</extension>
+<extension
+ point="org.eclipse.ui.actionSetPartAssociations">
+ <actionSetPartAssociation targetID="org.rubypeople.rdt.ui.RefactoringActionSet">
+ <part id="org.rubypeople.rdt.ui.EditorRubyFile"/>
+ </actionSetPartAssociation>
+</extension>
</plugin>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 18:59:44
|
Revision: 2892
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2892&view=rev
Author: cawilliams
Date: 2007-07-26 11:58:35 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
rest of fix for #5291 - For non-interactive gem manager processes don't show console.
When grabbing gem install path, also use under the hood process that won't show a console. Also modified gemManager to always load caches or gems (remote and local) in constructor. Now initialize() jobs just refresh those listings from original sources.
Lastly, listen for default vm changes. When it happens clear out our cached gem install path.
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.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-07-26 18:46:09 UTC (rev 2891)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-07-26 18:58:35 UTC (rev 2892)
@@ -43,11 +43,12 @@
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.rubypeople.rdt.internal.launching.StandardVMType;
import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
import org.rubypeople.rdt.launching.IVMInstall;
+import org.rubypeople.rdt.launching.IVMInstallChangedListener;
+import org.rubypeople.rdt.launching.PropertyChangeEvent;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -85,11 +86,24 @@
protected boolean isInitialized;
private GemManager() {
- gems = new HashSet<Gem>();
+ gems = loadLocalCache(getConfigFile(LOCAL_GEMS_CACHE_FILE));
// FIXME Somehow allow user to refresh remote gem list
// FIXME Do an incremental check for new remote gems somehow?
- remoteGems = new HashSet<Gem>();
+ remoteGems = loadLocalCache(getConfigFile(REMOTE_GEMS_CACHE_FILE));
listeners = new HashSet<GemListener>();
+ RubyRuntime.addVMInstallChangedListener(new IVMInstallChangedListener() {
+
+ public void vmRemoved(IVMInstall removedVm) {}
+
+ public void vmChanged(PropertyChangeEvent event) {}
+
+ public void vmAdded(IVMInstall newVm) {}
+
+ public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {
+ fGemInstallPath = null;
+ }
+
+ });
}
public boolean isInitialized() {
@@ -176,8 +190,7 @@
try {
lines = getContents();
} catch (DataFormatException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ AptanaRDTPlugin.log(e);
}
return convertToGems(lines);
} catch (MalformedURLException e) {
@@ -281,17 +294,26 @@
}
private Set<Gem> loadLocalGems() {
- if (!isRubyGemsInstalled()) return new HashSet<Gem>();
-
+ if (!isRubyGemsInstalled()) return new HashSet<Gem>();
+ GemParser parser = new GemParser();
+ List<String> commands = new ArrayList<String>();
+ commands.add(LIST_COMMAND);
+ commands.add(LOCAL_SWITCH);
+ return parser.parse(execAndReadOutput(commands));
+ }
+
+ private String execAndReadOutput(List<String> commands) {
StringBuffer buffer;
try {
List<String> line = new ArrayList<String>();
IVMInstall vm = RubyRuntime.getDefaultVMInstall();
+ if (vm == null) return "";
File executable = StandardVMType.findRubyExecutable(vm.getInstallLocation());
line.add(executable.getAbsolutePath());
line.add(getGemScriptPath());
- line.add(LIST_COMMAND);
- line.add(LOCAL_SWITCH);
+ for (String command : commands) {
+ line.add(command);
+ }
File workingDirectory = new File(getGemScriptPath()).getParentFile();
String[] cmdLine = new String[line.size()];
cmdLine = line.toArray(cmdLine);
@@ -305,14 +327,13 @@
}
} catch (CoreException e) {
AptanaRDTPlugin.log(e);
- return new HashSet<Gem>();
+ return "";
} catch (IOException e) {
AptanaRDTPlugin.log(e);
- return new HashSet<Gem>();
+ return "";
}
buffer.deleteCharAt(buffer.length() - 1); // remove last \n
- GemParser parser = new GemParser();
- return parser.parse(buffer.toString());
+ return buffer.toString();
}
/*
@@ -588,55 +609,21 @@
listeners.remove(listener);
}
- public IPath getGemInstallPath() { // FIXME Make like loadLocalGems, so a console view is never shown when this gets run!
+ public IPath getGemInstallPath() {
if (fGemInstallPath == null) {
if (!isRubyGemsInstalled()) return null;
- ILaunchConfiguration config = createGemLaunchConfiguration("environment", false);
- List<String> lines = readOutput(config);
- if (lines == null || lines.size() < 3) return null;
- String path = lines.get(2);
+ List<String> commands = new ArrayList<String>();
+ commands.add("environment");
+ String output = execAndReadOutput(commands);
+ String[] lines = output.split("\n");
+ if (lines == null || lines.length < 3) return null;
+ String path = lines[2];
path = path.substring(path.indexOf("INSTALLATION DIRECTORY:") + 23);
fGemInstallPath = new Path(path.trim());
}
return fGemInstallPath;
}
- private List<String> readOutput(ILaunchConfiguration config) {
- List<String> lines = new ArrayList<String>();
- File file = null;
- BufferedReader reader = null;
- try {
- ILaunch launch = config.launch(ILaunchManager.RUN_MODE, null);
- IProcess[] processes = launch.getProcesses();
- IProcess p = processes[0];
- while (!p.isTerminated()) {
- Thread.yield();
- }
- file = new File(config.getAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, (String) null));
- reader = new BufferedReader(new FileReader(file));
- String line = null;
- while ((line = reader.readLine()) != null) {
- lines.add(line);
- }
- } catch(CoreException e) {
- AptanaRDTPlugin.log(e);
- } catch (FileNotFoundException e) {
- AptanaRDTPlugin.log(e);
- } catch (IOException e) {
- AptanaRDTPlugin.log(e);
- } finally {
- try {
- if (reader != null) reader.close();
- } catch (IOException e) {
- // ignore
- }
- if (file != null) {
- file.delete();
- }
- }
- return lines;
- }
-
public IPath getGemPath(String gemName) {
IPath path = getGemInstallPath();
path = path.append("gems");
@@ -689,11 +676,10 @@
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- gems = loadLocalCache(getConfigFile(LOCAL_GEMS_CACHE_FILE));
- if (gems.isEmpty()) {
+// if (gems.isEmpty()) {
gems = loadLocalGems();
storeGemCache(gems, getConfigFile(LOCAL_GEMS_CACHE_FILE));
- }
+// }
isInitialized = true;
synchronized (listeners) {
for (GemListener listener : new ArrayList<GemListener>(listeners)) {
@@ -722,12 +708,11 @@
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- remoteGems = loadLocalCache(getConfigFile(REMOTE_GEMS_CACHE_FILE));
- if (remoteGems.isEmpty()) {
+// if (remoteGems.isEmpty()) {
remoteGems = loadRemoteGems();
storeGemCache(remoteGems,
getConfigFile(REMOTE_GEMS_CACHE_FILE));
- }
+// }
} catch (Exception e) {
AptanaRDTPlugin.log(e);
return Status.CANCEL_STATUS;
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.java 2007-07-26 18:46:09 UTC (rev 2891)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.java 2007-07-26 18:58:35 UTC (rev 2892)
@@ -5,12 +5,12 @@
import java.util.List;
import java.util.Set;
-import com.aptana.rdt.AptanaRDTPlugin;
import com.aptana.rdt.core.gems.Gem;
public class GemParser {
public Set<Gem> parse(String string) {
+ if (string == null || string.trim().length() == 0) return new HashSet<Gem>();
String[] raw = string.split("\n");
List<String> lines = new ArrayList<String>();
for (int i = 0; i < raw.length; i++) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 18:46:19
|
Revision: 2891
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2891&view=rev
Author: cawilliams
Date: 2007-07-26 11:46:09 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
partial fix for #5291 - For non-interactive gem manager processes don't show console. Run the process under the hood silently for loading local gems. Still need to do so for getGemInstallPath
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-07-26 17:05:19 UTC (rev 2890)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-07-26 18:46:09 UTC (rev 2891)
@@ -7,6 +7,7 @@
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
@@ -44,6 +45,7 @@
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.ui.IDebugUIConstants;
+import org.rubypeople.rdt.internal.launching.StandardVMType;
import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.RubyRuntime;
@@ -279,14 +281,36 @@
}
private Set<Gem> loadLocalGems() {
- if (!isRubyGemsInstalled()) return new HashSet<Gem>();
- ILaunchConfiguration config = createGemLaunchConfiguration(LIST_COMMAND + " " + LOCAL_SWITCH, false);
- List<String> lines = readOutput(config);
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < lines.size(); i++) {
- buffer.append(lines.get(i));
- if (i < (lines.size() - 1)) buffer.append("\n");
+ if (!isRubyGemsInstalled()) return new HashSet<Gem>();
+
+ StringBuffer buffer;
+ try {
+ List<String> line = new ArrayList<String>();
+ IVMInstall vm = RubyRuntime.getDefaultVMInstall();
+ File executable = StandardVMType.findRubyExecutable(vm.getInstallLocation());
+ line.add(executable.getAbsolutePath());
+ line.add(getGemScriptPath());
+ line.add(LIST_COMMAND);
+ line.add(LOCAL_SWITCH);
+ File workingDirectory = new File(getGemScriptPath()).getParentFile();
+ String[] cmdLine = new String[line.size()];
+ cmdLine = line.toArray(cmdLine);
+ Process p = DebugPlugin.exec(cmdLine, workingDirectory);
+ BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String liner = null;
+ buffer = new StringBuffer();
+ while ((liner = reader.readLine()) != null) {
+ buffer.append(liner);
+ buffer.append("\n");
+ }
+ } catch (CoreException e) {
+ AptanaRDTPlugin.log(e);
+ return new HashSet<Gem>();
+ } catch (IOException e) {
+ AptanaRDTPlugin.log(e);
+ return new HashSet<Gem>();
}
+ buffer.deleteCharAt(buffer.length() - 1); // remove last \n
GemParser parser = new GemParser();
return parser.parse(buffer.toString());
}
@@ -564,7 +588,7 @@
listeners.remove(listener);
}
- public IPath getGemInstallPath() {
+ public IPath getGemInstallPath() { // FIXME Make like loadLocalGems, so a console view is never shown when this gets run!
if (fGemInstallPath == null) {
if (!isRubyGemsInstalled()) return null;
ILaunchConfiguration config = createGemLaunchConfiguration("environment", false);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 17:05:20
|
Revision: 2890
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2890&view=rev
Author: cawilliams
Date: 2007-07-26 10:05:19 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
remove unused code
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java 2007-07-26 17:04:46 UTC (rev 2889)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java 2007-07-26 17:05:19 UTC (rev 2890)
@@ -5,7 +5,6 @@
import java.util.List;
import java.util.Map;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.rubypeople.rdt.core.IType;
import org.rubypeople.rdt.core.RubyModelException;
@@ -13,8 +12,6 @@
import org.rubypeople.rdt.internal.core.LogicalType;
import org.rubypeople.rdt.internal.core.Openable;
-import com.sun.org.apache.bcel.internal.generic.GETSTATIC;
-
public class HierarchyResolver {
private boolean superTypesOnly;
@@ -100,28 +97,11 @@
}
private IType getLogicalType(IType type, String name) {
-// if (type instanceof LogicalType) {
-// try {
-// return getLogicalType((LogicalType)type, name);
-// } catch (RubyModelException e) {
-// // ignore
-// }
-// }
RubyElementRequestor requestor = new RubyElementRequestor(type.getRubyScript());
IType[] types = requestor.findType(name);
if (types == null || types.length == 0) return null;
return new LogicalType(types);
}
-
- private IType getLogicalType(LogicalType type, String name) throws RubyModelException {
- IType[] types = type.getTypes();
- for (int i = 0; i < types.length; i++) {
- RubyElementRequestor requestor = new RubyElementRequestor(types[i].getRubyScript());
- IType[] result = requestor.findType(name);
- if (types != null && types.length > 0) return new LogicalType(result); // FIXME Concatenate results?
- }
- return null;
- }
private void reset() {
// this.focusType = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 17:05:00
|
Revision: 2889
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2889&view=rev
Author: cawilliams
Date: 2007-07-26 10:04:46 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
fix #5331 - Subtype Hierarchy doesn't actually show subtypes
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LogicalType.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LogicalType.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LogicalType.java 2007-07-26 16:48:59 UTC (rev 2888)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LogicalType.java 2007-07-26 17:04:46 UTC (rev 2889)
@@ -22,7 +22,7 @@
for (int i = 0; i < types.length; i++) {
IRubyElement[] subchildren = types[i].getChildren();
for (int j = 0; j < subchildren.length; j++) {
- children.add(subchildren[j]);
+ if (subchildren[j] != null) children.add(subchildren[j]);
}
}
return (IRubyElement[]) children.toArray(new IRubyElement[children.size()]);
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java 2007-07-26 16:48:59 UTC (rev 2888)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java 2007-07-26 17:04:46 UTC (rev 2889)
@@ -13,6 +13,8 @@
import org.rubypeople.rdt.internal.core.LogicalType;
import org.rubypeople.rdt.internal.core.Openable;
+import com.sun.org.apache.bcel.internal.generic.GETSTATIC;
+
public class HierarchyResolver {
private boolean superTypesOnly;
@@ -25,40 +27,25 @@
public void resolve(Openable[] openables, HashSet localTypes, IProgressMonitor monitor) {
try {
int openablesLength = openables.length;
- boolean[] hasLocalType = new boolean[openablesLength];
- org.rubypeople.rdt.core.IRubyScript[] cus = new org.rubypeople.rdt.core.IRubyScript[openablesLength];
- int unitsIndex = 0;
IType focus = this.builder.getType();
- Openable focusOpenable = null;
- if (focus != null) {
- focusOpenable = (Openable)focus.getRubyScript();
- }
for (int i = 0; i < openablesLength; i++) {
Openable openable = openables[i];
if (openable instanceof org.rubypeople.rdt.core.IRubyScript) {
org.rubypeople.rdt.core.IRubyScript cu = (org.rubypeople.rdt.core.IRubyScript)openable;
-
- // contains a potential subtype as a local or anonymous type?
- boolean containsLocalType = false;
- if (localTypes == null) { // case of hierarchy on region
- containsLocalType = true;
- } else {
- IPath path = cu.getPath();
- containsLocalType = localTypes.contains(path.toString());
- }
// Grab the types from the script and then connect them up!
IType[] types = cu.getAllTypes();
for (int j = 0; j < types.length; j++) {
IType type = types[j];
- if (!type.getFullyQualifiedName().equals(builder.focusQualifiedName)) continue;
- try {
- reportHierarchy(types[j]);
- } catch (RubyModelException e) {
- // ignore
- }
+ if (focusIsInHierarchy(focus, type)) { // if it's our focus type, or a subclass
+ try {
+ reportHierarchy(type);
+ } catch (RubyModelException e) {
+ // ignore
+ }
+ }
}
}
}
@@ -69,6 +56,12 @@
}
}
+ private boolean focusIsInHierarchy(IType focus, IType type) throws RubyModelException {
+ if (focus == null || type == null) return false;
+ if (type.getFullyQualifiedName().equals(focus.getFullyQualifiedName())) return true; // type is focus
+ return focusIsInHierarchy(focus, findSuperClass(type));
+ }
+
private void reportHierarchy(IType type) throws RubyModelException {
IType superclass;
if (type.isModule()){ // do not connect modules to Object
@@ -88,7 +81,14 @@
String[] names = type.getIncludedModuleNames();
List<IType> types = new ArrayList<IType>();
for (int i = 0; i < names.length; i++) {
- types.add(getLogicalType(type, names[i]));
+ IType logical = getLogicalType(type, names[i]);
+ if (logical == null) {
+ // try to see if full name is in same namespace.
+ String namespace = type.getFullyQualifiedName().substring(0, type.getFullyQualifiedName().length() - type.getElementName().length());
+ logical = getLogicalType(type, namespace + names[i]);
+ if (logical == null) continue;
+ }
+ types.add(logical);
}
return (IType[]) types.toArray(new IType[types.size()]);
}
@@ -100,11 +100,28 @@
}
private IType getLogicalType(IType type, String name) {
+// if (type instanceof LogicalType) {
+// try {
+// return getLogicalType((LogicalType)type, name);
+// } catch (RubyModelException e) {
+// // ignore
+// }
+// }
RubyElementRequestor requestor = new RubyElementRequestor(type.getRubyScript());
IType[] types = requestor.findType(name);
if (types == null || types.length == 0) return null;
return new LogicalType(types);
}
+
+ private IType getLogicalType(LogicalType type, String name) throws RubyModelException {
+ IType[] types = type.getTypes();
+ for (int i = 0; i < types.length; i++) {
+ RubyElementRequestor requestor = new RubyElementRequestor(types[i].getRubyScript());
+ IType[] result = requestor.findType(name);
+ if (types != null && types.length > 0) return new LogicalType(result); // FIXME Concatenate results?
+ }
+ return null;
+ }
private void reset() {
// this.focusType = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 16:49:01
|
Revision: 2888
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2888&view=rev
Author: cawilliams
Date: 2007-07-26 09:48:59 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
avoid possible null pointer
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/CodeReloader.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/CodeReloader.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/CodeReloader.java 2007-07-26 15:24:14 UTC (rev 2887)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/CodeReloader.java 2007-07-26 16:48:59 UTC (rev 2888)
@@ -22,6 +22,7 @@
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.IWindowListener;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.rubypeople.rdt.internal.debug.core.model.RubyDebugTarget;
@@ -115,7 +116,9 @@
public void run() {
IWorkbenchWindow activeWindow = RdtDebugUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
if (activeWindow == null) { return; }
- addAsListener(RdtDebugUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart());
+ IWorkbenchPage page = activeWindow.getActivePage();
+ if (page == null) { return; }
+ addAsListener(page.getActivePart());
}
});
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 15:24:17
|
Revision: 2887
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2887&view=rev
Author: cawilliams
Date: 2007-07-26 08:24:14 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
always initialize (since GemManager is now smart enough to avoid null pointers hopefully). Also add VM listener, and when teh default VM changes, refresh the local gem listing
Modified Paths:
--------------
trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java
Modified: trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java
===================================================================
--- trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java 2007-07-26 15:22:21 UTC (rev 2886)
+++ trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java 2007-07-26 15:24:14 UTC (rev 2887)
@@ -11,18 +11,13 @@
public class RubyGemsInitializer implements IStartup, IVMInstallChangedListener {
public void earlyStartup() {
- // If ruby isn't set up, listen until we have an interpreter
- IVMInstall vm = RubyRuntime.getDefaultVMInstall();
- if (vm == null) {
- RubyRuntime.addVMInstallChangedListener(this);
- } else {
- AptanaRDTPlugin.getDefault().getGemManager().initialize();
- }
+ AptanaRDTPlugin.getDefault().getGemManager().initialize();
+ RubyRuntime.addVMInstallChangedListener(this); // when default interpreter changes, refresh local gem listing
}
public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {
- if (current != null && !AptanaRDTPlugin.getDefault().getGemManager().isInitialized()) {
- AptanaRDTPlugin.getDefault().getGemManager().initialize();
+ if (current != null) {
+ AptanaRDTPlugin.getDefault().getGemManager().refresh();
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 15:22:24
|
Revision: 2886
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2886&view=rev
Author: cawilliams
Date: 2007-07-26 08:22:21 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
make isRubyGemsInstalled a public method. Add docs for most of the IGemManager methods
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/IGemManager.java
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/IGemManager.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/IGemManager.java 2007-07-26 15:09:09 UTC (rev 2885)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/IGemManager.java 2007-07-26 15:22:21 UTC (rev 2886)
@@ -6,34 +6,118 @@
public interface IGemManager {
- public abstract boolean update(Gem gem);
+ /**
+ * Returns a listing of the local gems.
+ *
+ * @return a Set<Gem> of the installed gems.
+ */
+ public Set<Gem> getGems();
- public abstract boolean installGem(Gem gem);
+ /**
+ * Returns a listing of the remote gems.
+ *
+ * @return a Set<Gem> of the remote gems available for install.
+ */
+ public Set<Gem> getRemoteGems();
- public abstract boolean removeGem(Gem gem);
+ public boolean installGem(Gem gem);
- public abstract Set<Gem> getGems();
+ /**
+ * Removes or uninstalls the supplied gem.
+ *
+ * @param gem
+ * the Gem to remove
+ * @return a boolean indicating whether the operation was a success.
+ */
+ public boolean removeGem(Gem gem);
- public abstract boolean refresh();
+ /**
+ * Updates the supplied gem, if a newer version is available.
+ *
+ * @param gem
+ * the Gem to update
+ * @return a boolean indicating whether the operation was a success.
+ */
+ public boolean update(Gem gem);
- public abstract void addGemListener(GemListener listener);
+ /**
+ * Runs a "gem update" command for all gems. For any local gems that have a
+ * newer version, the IOGemManager will install the new versions.
+ *
+ * @return a boolean indicating whether the operation was a success.
+ */
+ public boolean updateAll();
- public abstract Set<Gem> getRemoteGems();
+ /**
+ * Query method to indicate if a gem using the supplied name is installed
+ * locally.
+ *
+ * @param gemName
+ * The unique name of the gem
+ * @return a boolean indicating whether the gem is installed
+ */
+ public boolean gemInstalled(String gemName);
- public abstract boolean gemInstalled(String gemName);
+ /**
+ * Forces the GemManager to refresh it's listing of local gems
+ *
+ * @return a boolean indicating if it was a successful operation
+ */
+ public boolean refresh();
- public abstract void removeGemListener(GemListener listener);
+ public void addGemListener(GemListener listener);
- public abstract IPath getGemInstallPath();
+ public void removeGemListener(GemListener listener);
- public abstract IPath getGemPath(String gemName);
-
- public abstract IPath getGemPath(String gemName, String version);
+ /**
+ * The base IPath where gems are installed.
+ *
+ * @return an IPath indicating where gems get installed
+ */
+ public IPath getGemInstallPath();
- public abstract boolean updateAll();
-
- public abstract boolean isInitialized();
+ /**
+ * Returns an IPath pointing to the latest version of the gem with the
+ * supplied name.
+ *
+ * @param gemName
+ * @return an IPath pointing to the gem's location on disk for the latest
+ * version of the gem
+ */
+ public IPath getGemPath(String gemName);
- public abstract void initialize();
+ /**
+ * Returns an IPath pointing to the supplied version of the gem with the
+ * supplied name.
+ *
+ * @param gemName
+ * The name of the gem to match
+ * @param version
+ * The version to match
+ * @return an IPath pointing to the gem's location on disk
+ */
+ public IPath getGemPath(String gemName, String version);
+ /**
+ * Determine whether it appears that the RubyGems library is installed (for
+ * the current/default VM).
+ *
+ * @return a boolean indicating if it appears that RubyGems is installed
+ */
+ public boolean isRubyGemsInstalled();
+
+ /**
+ * Forces the IGemManager to load local cached copies of the remote and
+ * local gems listings. If empty, it refreshes it's local and remote gem
+ * listing from original sources.
+ */
+ public void initialize();
+
+ /**
+ * Query to indicate whether the IGemManager has been initialized yet.
+ *
+ * @return
+ */
+ public boolean isInitialized();
+
}
\ No newline at end of file
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-07-26 15:09:09 UTC (rev 2885)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-07-26 15:22:21 UTC (rev 2886)
@@ -389,7 +389,7 @@
return path + File.separator + "bin" + File.separator + "gem";
}
- private boolean isRubyGemsInstalled() {
+ public boolean isRubyGemsInstalled() {
String path = getGemScriptPath();
if (path == null) return false;
File file = new File(path);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 15:09:16
|
Revision: 2885
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2885&view=rev
Author: cawilliams
Date: 2007-07-26 08:09:09 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
if it looks like we don't have ruby installed/setup or rubygems installed then don't actually run anythign that requires the gem file. Instead do a check and return a boolean/empty collection before getting into bad situation.
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-07-26 15:02:42 UTC (rev 2884)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-07-26 15:09:09 UTC (rev 2885)
@@ -169,7 +169,6 @@
}
private Set<Gem> loadRemoteGems() {
-
try {
List<String> lines = new ArrayList<String>();
try {
@@ -280,6 +279,7 @@
}
private Set<Gem> loadLocalGems() {
+ if (!isRubyGemsInstalled()) return new HashSet<Gem>();
ILaunchConfiguration config = createGemLaunchConfiguration(LIST_COMMAND + " " + LOCAL_SWITCH, false);
List<String> lines = readOutput(config);
StringBuffer buffer = new StringBuffer();
@@ -297,6 +297,7 @@
* @see com.aptana.rdt.internal.gems.IGemManager#update(com.aptana.rdt.internal.gems.Gem)
*/
public boolean update(final Gem gem) {
+ if (!isRubyGemsInstalled()) return false;
try {
String command = UPDATE_COMMAND + " " + gem.getName();
ILaunchConfiguration config = createGemLaunchConfiguration(command, true);
@@ -382,10 +383,18 @@
private static String getGemScriptPath() {
IVMInstall vm = RubyRuntime.getDefaultVMInstall();
+ if (vm == null) return null;
File installLocation = vm.getInstallLocation();
String path = installLocation.getAbsolutePath();
return path + File.separator + "bin" + File.separator + "gem";
}
+
+ private boolean isRubyGemsInstalled() {
+ String path = getGemScriptPath();
+ if (path == null) return false;
+ File file = new File(path);
+ return file.exists();
+ }
/*
* (non-Javadoc)
@@ -393,6 +402,7 @@
* @see com.aptana.rdt.internal.gems.IGemManager#installGem(com.aptana.rdt.internal.gems.Gem)
*/
public boolean installGem(final Gem gem) {
+ if (!isRubyGemsInstalled()) return false;
try {
String command = INSTALL_COMMAND + " " + gem.getName();
if (gem.getVersion() != null
@@ -434,6 +444,7 @@
* @see com.aptana.rdt.internal.gems.IGemManager#removeGem(com.aptana.rdt.internal.gems.Gem)
*/
public boolean removeGem(final Gem gem) {
+ if (!isRubyGemsInstalled()) return false;
try {
String command = UNINSTALL_COMMAND + " " + gem.getName();
if (gem.getVersion() != null
@@ -555,6 +566,7 @@
public IPath getGemInstallPath() {
if (fGemInstallPath == null) {
+ if (!isRubyGemsInstalled()) return null;
ILaunchConfiguration config = createGemLaunchConfiguration("environment", false);
List<String> lines = readOutput(config);
if (lines == null || lines.size() < 3) return null;
@@ -618,6 +630,7 @@
}
public boolean updateAll() {
+ if (!isRubyGemsInstalled()) return false;
try {
ILaunchConfiguration config = createGemLaunchConfiguration(UPDATE_COMMAND, true);
final ILaunch launch = config.launch(ILaunchManager.RUN_MODE, null);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-26 15:02:44
|
Revision: 2884
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2884&view=rev
Author: cawilliams
Date: 2007-07-26 08:02:42 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
if no default vm is installed/chosen, add listener and wait until we get one, then initialize the gem manager
Modified Paths:
--------------
trunk/com.aptana.rdt.ui/META-INF/MANIFEST.MF
trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java
Modified: trunk/com.aptana.rdt.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/com.aptana.rdt.ui/META-INF/MANIFEST.MF 2007-07-25 19:17:49 UTC (rev 2883)
+++ trunk/com.aptana.rdt.ui/META-INF/MANIFEST.MF 2007-07-26 15:02:42 UTC (rev 2884)
@@ -11,6 +11,7 @@
org.eclipse.jface.text,
org.rubypeople.rdt.core,
com.aptana.rdt,
- org.rubypeople.rdt.ui
+ org.rubypeople.rdt.ui,
+ org.rubypeople.rdt.launching
Eclipse-LazyStart: true
Export-Package: com.aptana.rdt.internal.ui.preferences
Modified: trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java
===================================================================
--- trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java 2007-07-25 19:17:49 UTC (rev 2883)
+++ trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java 2007-07-26 15:02:42 UTC (rev 2884)
@@ -1,13 +1,38 @@
package com.aptana.rdt.ui;
import org.eclipse.ui.IStartup;
+import org.rubypeople.rdt.launching.IVMInstall;
+import org.rubypeople.rdt.launching.IVMInstallChangedListener;
+import org.rubypeople.rdt.launching.PropertyChangeEvent;
+import org.rubypeople.rdt.launching.RubyRuntime;
import com.aptana.rdt.AptanaRDTPlugin;
-public class RubyGemsInitializer implements IStartup {
+public class RubyGemsInitializer implements IStartup, IVMInstallChangedListener {
public void earlyStartup() {
- AptanaRDTPlugin.getDefault().getGemManager().initialize();
+ // If ruby isn't set up, listen until we have an interpreter
+ IVMInstall vm = RubyRuntime.getDefaultVMInstall();
+ if (vm == null) {
+ RubyRuntime.addVMInstallChangedListener(this);
+ } else {
+ AptanaRDTPlugin.getDefault().getGemManager().initialize();
+ }
}
+ public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {
+ if (current != null && !AptanaRDTPlugin.getDefault().getGemManager().isInitialized()) {
+ AptanaRDTPlugin.getDefault().getGemManager().initialize();
+ }
+ }
+
+ public void vmAdded(IVMInstall newVm) {
+ }
+
+ public void vmChanged(PropertyChangeEvent event) {
+ }
+
+ public void vmRemoved(IVMInstall removedVm) {
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-25 19:17:51
|
Revision: 2883
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2883&view=rev
Author: cawilliams
Date: 2007-07-25 12:17:49 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/CollectingSearchRequestor.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/CollectingSearchRequestor.java
Copied: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/CollectingSearchRequestor.java (from rev 2724, trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/CollectingSearchRequestor.java)
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/CollectingSearchRequestor.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/CollectingSearchRequestor.java 2007-07-25 19:17:49 UTC (rev 2883)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.rubypeople.rdt.core.search;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * Collects the results returned by a <code>SearchEngine</code>.
+ */
+public class CollectingSearchRequestor extends SearchRequestor {
+ private ArrayList<SearchMatch> fFound;
+
+ public CollectingSearchRequestor() {
+ fFound = new ArrayList<SearchMatch>();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch)
+ */
+ public void acceptSearchMatch(SearchMatch match) throws CoreException {
+ fFound.add(match);
+ }
+
+ /**
+ * @return a List of {@link SearchMatch}es (not sorted)
+ */
+ public List<SearchMatch> getResults() {
+ return fFound;
+ }
+}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-07-25 18:47:27 UTC (rev 2882)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-07-25 19:17:49 UTC (rev 2883)
@@ -46,6 +46,7 @@
import org.rubypeople.rdt.core.IType;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
+import org.rubypeople.rdt.core.search.CollectingSearchRequestor;
import org.rubypeople.rdt.core.search.IRubySearchConstants;
import org.rubypeople.rdt.core.search.IRubySearchScope;
import org.rubypeople.rdt.core.search.SearchMatch;
@@ -55,7 +56,6 @@
import org.rubypeople.rdt.internal.core.RubyType;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.core.search.BasicSearchEngine;
-import org.rubypeople.rdt.internal.core.search.CollectingSearchRequestor;
import org.rubypeople.rdt.internal.core.util.ASTUtil;
import org.rubypeople.rdt.internal.core.util.Util;
import org.rubypeople.rdt.internal.ti.BasicTypeGuess;
@@ -277,7 +277,9 @@
types = filtered.toArray(new IType[filtered.size()]);
includeInstance = false;
} else if (element instanceof IType) {
- types = new IType[] {(IType) element};
+ IType type = (IType) element;
+ RubyElementRequestor requestor = new RubyElementRequestor(script);
+ types = requestor.findType(type.getFullyQualifiedName());
} else {
types = new IType[] {element.getDeclaringType()};
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java 2007-07-25 18:47:27 UTC (rev 2882)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java 2007-07-25 19:17:49 UTC (rev 2883)
@@ -8,13 +8,13 @@
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.IType;
import org.rubypeople.rdt.core.RubyCore;
+import org.rubypeople.rdt.core.search.CollectingSearchRequestor;
import org.rubypeople.rdt.core.search.IRubySearchConstants;
import org.rubypeople.rdt.core.search.IRubySearchScope;
import org.rubypeople.rdt.core.search.SearchMatch;
import org.rubypeople.rdt.core.search.SearchParticipant;
import org.rubypeople.rdt.core.search.SearchPattern;
import org.rubypeople.rdt.internal.core.search.BasicSearchEngine;
-import org.rubypeople.rdt.internal.core.search.CollectingSearchRequestor;
public class RubyElementRequestor {
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java 2007-07-25 18:47:27 UTC (rev 2882)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java 2007-07-25 19:17:49 UTC (rev 2883)
@@ -39,6 +39,7 @@
import org.rubypeople.rdt.core.IType;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
+import org.rubypeople.rdt.core.search.CollectingSearchRequestor;
import org.rubypeople.rdt.core.search.IRubySearchConstants;
import org.rubypeople.rdt.core.search.IRubySearchScope;
import org.rubypeople.rdt.core.search.SearchEngine;
@@ -48,7 +49,6 @@
import org.rubypeople.rdt.internal.core.RubyScript;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.core.search.BasicSearchEngine;
-import org.rubypeople.rdt.internal.core.search.CollectingSearchRequestor;
import org.rubypeople.rdt.internal.core.util.ASTUtil;
import org.rubypeople.rdt.internal.core.util.Util;
import org.rubypeople.rdt.internal.ti.DefaultTypeInferrer;
Deleted: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/CollectingSearchRequestor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/CollectingSearchRequestor.java 2007-07-25 18:47:27 UTC (rev 2882)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/CollectingSearchRequestor.java 2007-07-25 19:17:49 UTC (rev 2883)
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.rubypeople.rdt.internal.core.search;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.rubypeople.rdt.core.search.SearchMatch;
-import org.rubypeople.rdt.core.search.SearchRequestor;
-
-/**
- * Collects the results returned by a <code>SearchEngine</code>.
- */
-public class CollectingSearchRequestor extends SearchRequestor {
- private ArrayList<SearchMatch> fFound;
-
- public CollectingSearchRequestor() {
- fFound = new ArrayList<SearchMatch>();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch)
- */
- public void acceptSearchMatch(SearchMatch match) throws CoreException {
- fFound.add(match);
- }
-
- /**
- * @return a List of {@link SearchMatch}es (not sorted)
- */
- public List<SearchMatch> getResults() {
- return fFound;
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-25 18:47:30
|
Revision: 2882
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2882&view=rev
Author: cawilliams
Date: 2007-07-25 11:47:27 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
grab new com.aptana.rdt.ui plugin
Modified Paths:
--------------
trunk/org.rubypeople.rdt.pluginbuilder/build-files/fetchSvnAll.xml
Modified: trunk/org.rubypeople.rdt.pluginbuilder/build-files/fetchSvnAll.xml
===================================================================
--- trunk/org.rubypeople.rdt.pluginbuilder/build-files/fetchSvnAll.xml 2007-07-25 18:44:57 UTC (rev 2881)
+++ trunk/org.rubypeople.rdt.pluginbuilder/build-files/fetchSvnAll.xml 2007-07-25 18:47:27 UTC (rev 2882)
@@ -70,6 +70,11 @@
<param name="element.id" value="com.aptana.rdt"/>
<param name="project.name" value="com.aptana.rdt"/>
</antcall>
+ <antcall target="svn.co">
+ <param name="target" value="plugins"/>
+ <param name="element.id" value="com.aptana.rdt.ui"/>
+ <param name="project.name" value="com.aptana.rdt.ui"/>
+ </antcall>
<antcall target="svn.co">
<param name="target" value="features"/>
<param name="element.id" value="org.rubypeople.rdt-tests"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-25 18:45:00
|
Revision: 2881
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2881&view=rev
Author: cawilliams
Date: 2007-07-25 11:44:57 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
remove unused dependency
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
Modified: trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:44:18 UTC (rev 2880)
+++ trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:44:57 UTC (rev 2881)
@@ -23,7 +23,6 @@
org.rubypeople.rdt.internal.ti.util
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
- org.eclipse.team.core,
org.eclipse.jface.text,
org.jruby,
org.eclipse.core.filesystem
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-25 18:44:20
|
Revision: 2880
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2880&view=rev
Author: cawilliams
Date: 2007-07-25 11:44:18 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
hide org.rubypeople.rdt.internal.core.buffer
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
Modified: trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:36:32 UTC (rev 2879)
+++ trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:44:18 UTC (rev 2880)
@@ -15,7 +15,6 @@
org.rubypeople.rdt.core.util,
org.rubypeople.rdt.internal.compiler,
org.rubypeople.rdt.internal.core,
- org.rubypeople.rdt.internal.core.buffer,
org.rubypeople.rdt.internal.core.parser,
org.rubypeople.rdt.internal.core.parser.warnings;x-friends:="com.aptana.rdt",
org.rubypeople.rdt.internal.core.util,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-25 18:36:33
|
Revision: 2879
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2879&view=rev
Author: cawilliams
Date: 2007-07-25 11:36:32 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
update included items in build
Modified Paths:
--------------
trunk/com.aptana.rdt/build.properties
Modified: trunk/com.aptana.rdt/build.properties
===================================================================
--- trunk/com.aptana.rdt/build.properties 2007-07-25 18:36:28 UTC (rev 2878)
+++ trunk/com.aptana.rdt/build.properties 2007-07-25 18:36:32 UTC (rev 2879)
@@ -1,9 +1,6 @@
bin.includes = plugin.xml,\
META-INF/,\
- icons/,\
- cheatsheets/,\
plugin.properties,\
- lib/,\
.
src.includes = src/,\
plugin.properties,\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-25 18:36:29
|
Revision: 2878
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2878&view=rev
Author: cawilliams
Date: 2007-07-25 11:36:28 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
update included items in build
Modified Paths:
--------------
trunk/com.aptana.rdt.ui/build.properties
Modified: trunk/com.aptana.rdt.ui/build.properties
===================================================================
--- trunk/com.aptana.rdt.ui/build.properties 2007-07-25 18:34:33 UTC (rev 2877)
+++ trunk/com.aptana.rdt.ui/build.properties 2007-07-25 18:36:28 UTC (rev 2878)
@@ -2,4 +2,7 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.xml
+ plugin.xml,\
+ icons/
+src.includes = plugin.xml,\
+ src/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-25 18:34:34
|
Revision: 2877
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2877&view=rev
Author: cawilliams
Date: 2007-07-25 11:34:33 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
hide org.rubypeople.rdt.internal.core.builder
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
Modified: trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:34:28 UTC (rev 2876)
+++ trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:34:33 UTC (rev 2877)
@@ -16,7 +16,6 @@
org.rubypeople.rdt.internal.compiler,
org.rubypeople.rdt.internal.core,
org.rubypeople.rdt.internal.core.buffer,
- org.rubypeople.rdt.internal.core.builder,
org.rubypeople.rdt.internal.core.parser,
org.rubypeople.rdt.internal.core.parser.warnings;x-friends:="com.aptana.rdt",
org.rubypeople.rdt.internal.core.util,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-25 18:34:31
|
Revision: 2876
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2876&view=rev
Author: cawilliams
Date: 2007-07-25 11:34:28 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
hide org.rubypeople.rdt.internal.core.builder
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java 2007-07-25 18:19:35 UTC (rev 2875)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java 2007-07-25 18:34:28 UTC (rev 2876)
@@ -4,98 +4,82 @@
import java.util.Arrays;
import java.util.List;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+import org.rubypeople.rdt.core.IParent;
import org.rubypeople.rdt.core.IRubyElement;
-import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.RubyCore;
-import org.rubypeople.rdt.core.RubyModelException;
-import org.rubypeople.rdt.internal.core.RubyElement;
-import org.rubypeople.rdt.internal.core.builder.RubySourceFileCollectingVisitor;
-import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.ui.RubyElementLabelProvider;
public class RubyTypeSelectionDialog extends ElementListSelectionDialog {
- public RubyTypeSelectionDialog(Shell parent) {
- super(parent, new RubyElementLabelProvider(RubyElementLabelProvider.SHOW_DEFAULT | RubyElementLabelProvider.SHOW_POST_QUALIFIED));
- setElements(getElements());
- setMultipleSelection(false);
- }
-
- /**
- * Meant for subclasses to override what elements to show
- * @return
- */
- protected Object[] getElements() {
- // FIXME This doesn't pick up all the classes in loadpaths (Ruby library)! We need to search through rubProject.getSourceFolders to do that.
- // FIXME If we move to grabbing all types via source fodlers it gets way too slow. We need to make this set up liek JDT so it runs a search job based on input and caches results.
- return getAllTypes();
- }
+ public RubyTypeSelectionDialog(Shell parent) {
+ super(parent, new RubyElementLabelProvider(
+ RubyElementLabelProvider.SHOW_DEFAULT
+ | RubyElementLabelProvider.SHOW_POST_QUALIFIED));
+ setElements(getElements());
+ setMultipleSelection(false);
+ }
- /**
- * @return
- */
- private IRubyElement[] getAllTypes() {
- List typeList = new ArrayList();
- IProject[] projects = RubyCore.getRubyProjects();
- for (int i = 0; i < projects.length; i++) {
- IRubyElement[] types = findElements(projects[i], IRubyElement.TYPE);
- typeList.addAll(Arrays.asList(types));
- }
- IRubyElement[] allTypes = new IRubyElement[typeList.size()];
- System.arraycopy(typeList.toArray(), 0, allTypes, 0, allTypes.length);
- return allTypes;
- }
+ /**
+ * Meant for subclasses to override what elements to show
+ *
+ * @return
+ */
+ protected Object[] getElements() {
+ // FIXME This doesn't pick up all the classes in loadpaths (Ruby
+ // library)! We need to search through rubProject.getSourceFolders to do
+ // that.
+ // FIXME If we move to grabbing all types via source fodlers it gets way
+ // too slow. We need to make this set up liek JDT so it runs a search
+ // job based on input and caches results.
+ return getAllTypes();
+ }
- public static IRubyElement[] findElements(final IFile file, int elementType) {
- IRubyScript script = RubyCore.create(file);
- if (script == null) return new IRubyElement[0];
- try {
- script.reconcile();
- IRubyElement[] children = script.getChildren();
- List types = new ArrayList();
- for (int i = 0; i < children.length; i++) {
- if (children[i].isType(elementType)) types.add(children[i]);
- }
- IRubyElement[] array = new IRubyElement[types.size()];
- System.arraycopy(types.toArray(), 0, array, 0, types.size());
- return array;
- } catch (RubyModelException e) {
- RubyPlugin.log(e);
- }
- return new IRubyElement[0];
- }
+ /**
+ * @return
+ */
+ private IRubyElement[] getAllTypes() {
+ List typeList = new ArrayList();
+ IProject[] projects = RubyCore.getRubyProjects();
+ for (int i = 0; i < projects.length; i++) {
+ IRubyElement[] types = findElements(projects[i], IRubyElement.TYPE);
+ typeList.addAll(Arrays.asList(types));
+ }
+ IRubyElement[] allTypes = new IRubyElement[typeList.size()];
+ System.arraycopy(typeList.toArray(), 0, allTypes, 0, allTypes.length);
+ return allTypes;
+ }
- /**
- * @param rubyProject
- * @param elementType
- */
- public static IRubyElement[] findElements(IProject rubyProject, int elementType) {
- if (rubyProject == null) { return new IRubyElement[0]; }
- try {
- List files = new ArrayList();
- RubySourceFileCollectingVisitor yeah = new RubySourceFileCollectingVisitor(files);
- rubyProject.accept(yeah, 0);
- List allElements = new ArrayList();
- for (int i = 0; i < files.size(); i++) {
- IFile rubyFile = (IFile) files.get(i);
- IRubyElement[] fileElements = findElements(rubyFile, elementType);
- for (int j = 0; j < fileElements.length; j++) {
- allElements.add(fileElements[j]);
- }
- }
- Object[] listArray = allElements.toArray();
- IRubyElement[] array = new IRubyElement[allElements.size()];
- System.arraycopy(listArray, 0, array, 0, listArray.length);
- return array;
- } catch (CoreException e) {
- e.printStackTrace();
- }
- return new RubyElement[0];
- }
+ public static IRubyElement[] findElements(final IRubyElement element, int elementType) {
+ List<IRubyElement> allElements = new ArrayList<IRubyElement>();
+ if (element.isType(elementType))
+ allElements.add(element);
+ if (element instanceof IParent) {
+ IParent parent = (IParent) element;
+ IRubyElement[] fileElements = findElements(element, elementType);
+ for (int j = 0; j < fileElements.length; j++) {
+ allElements.add(fileElements[j]);
+ }
+ }
+ IRubyElement[] elements = new IRubyElement[allElements.size()];
+ elements = allElements.toArray(new IRubyElement[allElements.size()]);
+ return elements;
+ }
+ /**
+ * @param rubyProject
+ * @param elementType
+ */
+ public static IRubyElement[] findElements(IProject rubyProject,
+ int elementType) {
+ if (rubyProject == null) {
+ return new IRubyElement[0];
+ }
+ IRubyProject proj = RubyCore.create(rubyProject);
+ return findElements(proj, elementType);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-25 18:19:36
|
Revision: 2875
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2875&view=rev
Author: cawilliams
Date: 2007-07-25 11:19:35 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
make org.rubypeople.rdt.internal.core.parser.warnings visible only to com.aptana.rdt plugin
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
Modified: trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:16:02 UTC (rev 2874)
+++ trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:19:35 UTC (rev 2875)
@@ -18,7 +18,7 @@
org.rubypeople.rdt.internal.core.buffer,
org.rubypeople.rdt.internal.core.builder,
org.rubypeople.rdt.internal.core.parser,
- org.rubypeople.rdt.internal.core.parser.warnings,
+ org.rubypeople.rdt.internal.core.parser.warnings;x-friends:="com.aptana.rdt",
org.rubypeople.rdt.internal.core.util,
org.rubypeople.rdt.internal.formatter,
org.rubypeople.rdt.internal.ti,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-25 18:16:05
|
Revision: 2874
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2874&view=rev
Author: cawilliams
Date: 2007-07-25 11:16:02 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
hide org.rubypeople.rdt.internal.core.search
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
Modified: trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:13:48 UTC (rev 2873)
+++ trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:16:02 UTC (rev 2874)
@@ -19,7 +19,6 @@
org.rubypeople.rdt.internal.core.builder,
org.rubypeople.rdt.internal.core.parser,
org.rubypeople.rdt.internal.core.parser.warnings,
- org.rubypeople.rdt.internal.core.search,
org.rubypeople.rdt.internal.core.util,
org.rubypeople.rdt.internal.formatter,
org.rubypeople.rdt.internal.ti,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-07-25 18:13:49
|
Revision: 2873
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2873&view=rev
Author: cawilliams
Date: 2007-07-25 11:13:48 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
hide org.rubypeople.rdt.internal.codeassist
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
Modified: trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:13:44 UTC (rev 2872)
+++ trunk/org.rubypeople.rdt.core/META-INF/MANIFEST.MF 2007-07-25 18:13:48 UTC (rev 2873)
@@ -23,8 +23,7 @@
org.rubypeople.rdt.internal.core.util,
org.rubypeople.rdt.internal.formatter,
org.rubypeople.rdt.internal.ti,
- org.rubypeople.rdt.internal.ti.util,
- org.rubypeople.rdt.internal.codeassist
+ org.rubypeople.rdt.internal.ti.util
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.team.core,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|