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-01-31 14:39:26
|
Revision: 1897
http://svn.sourceforge.net/rubyeclipse/?rev=1897&view=rev
Author: cawilliams
Date: 2007-01-31 06:39:18 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
fix some problems with source folders that was showing up in a new class wizard. We were getting duplicates of source folders in our model hierarchy, and adding/deleting a folder under the source root wasn't affecting the model.
Also, change wording of label for choosing a folder, and remove option to generate a "main" method
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRoot.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/NewWizardMessages.properties
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewClassWizardPage.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewContainerWizardPage.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java 2007-01-30 20:35:57 UTC (rev 1896)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java 2007-01-31 14:39:18 UTC (rev 1897)
@@ -656,9 +656,9 @@
RootInfo rootInfo = null;
int elementType;
IProject proj = (IProject) res;
- boolean wasJavaProject = this.state.findRubyProject(proj.getName()) != null;
- boolean isJavaProject = RubyProject.hasRubyNature(proj);
- if (!wasJavaProject && !isJavaProject) {
+ boolean wasRubyProject = this.state.findRubyProject(proj.getName()) != null;
+ boolean isRubyProject = RubyProject.hasRubyNature(proj);
+ if (!wasRubyProject && !isRubyProject) {
elementType = NON_RUBY_RESOURCE;
} else {
rootInfo = this.enclosingRootInfo(res.getFullPath(), delta.getKind());
@@ -673,7 +673,7 @@
this.traverseDelta(delta, elementType, rootInfo);
if (elementType == NON_RUBY_RESOURCE
- || (wasJavaProject != isJavaProject && (delta.getKind()) == IResourceDelta.CHANGED)) { // project
+ || (wasRubyProject != isRubyProject && (delta.getKind()) == IResourceDelta.CHANGED)) { // project
// has
// changed
// nature
@@ -1160,17 +1160,109 @@
// process children if needed
if (processChildren) {
IResourceDelta[] children = delta.getAffectedChildren();
- boolean oneChildOnClasspath = false;
+ boolean oneChildOnLoadpath = false;
int length = children.length;
IResourceDelta[] orphanChildren = null;
Openable parent = null;
boolean isValidParent = true;
- if (orphanChildren != null && (oneChildOnClasspath // orphan
+
+
+ for (int i = 0; i < length; i++) {
+ IResourceDelta child = children[i];
+ IResource childRes = child.getResource();
+
+ // find out whether the child is a source folder root of the current project
+ IPath childPath = childRes.getFullPath();
+ int childKind = child.getKind();
+ RootInfo childRootInfo = this.rootInfo(childPath, childKind);
+ if (childRootInfo != null && !childRootInfo.isRootOfProject(childPath)) {
+ // package fragment root of another project (dealt with later)
+ childRootInfo = null;
+ }
+
+ // compute child type
+ int childType =
+ this.elementType(
+ childRes,
+ childKind,
+ elementType,
+ rootInfo == null ? childRootInfo : rootInfo
+ );
+
+ // is childRes in the output folder and is it filtered out ?
+ boolean isResFilteredFromOutput = false;
+
+ boolean isNestedRoot = rootInfo != null && childRootInfo != null;
+ if (!isResFilteredFromOutput
+ && !isNestedRoot) { // do not treat as non-ruby rsc if nested root
+
+ this.traverseDelta(child, childType, rootInfo == null ? childRootInfo : rootInfo); // traverse delta for child in the same project
+
+ if (childType == NON_RUBY_RESOURCE) {
+ if (rootInfo != null) { // if inside a source folder root
+ if (!isValidParent) continue;
+ if (parent == null) {
+ // find the parent of the non-ruby resource to attach to
+ if (this.currentElement == null
+ || !rootInfo.project.equals(this.currentElement.getRubyProject())) { // note if currentElement is the IRubyModel, getJavaProject() is null
+ // force the currentProject to be used
+ this.currentElement = rootInfo.project;
+ }
+ if (elementType == IRubyElement.RUBY_PROJECT
+ || (elementType == IRubyElement.SOURCE_FOLDER_ROOT
+ && res instanceof IProject)) {
+ // NB: attach non-ruby resource to project (not to its package fragment root)
+ parent = rootInfo.project;
+ } else {
+ parent = this.createElement(res, elementType, rootInfo);
+ }
+ if (parent == null) {
+ isValidParent = false;
+ continue;
+ }
+ }
+ // add child as non ruby resource
+ try {
+ nonRubyResourcesChanged(parent, child);
+ } catch (RubyModelException e) {
+ // ignore
+ }
+ } else {
+ // the non-ruby resource (or its parent folder) will be attached to the ruby project
+ if (orphanChildren == null) orphanChildren = new IResourceDelta[length];
+ orphanChildren[i] = child;
+ }
+ } else {
+ oneChildOnLoadpath = true;
+ }
+ } else {
+ oneChildOnLoadpath = true; // to avoid reporting child delta as non-ruby resource delta
+ }
+
+ // if child is a nested root
+ // or if it is not a package fragment root of the current project
+ // but it is a package fragment root of another project, traverse delta too
+ if (isNestedRoot
+ || (childRootInfo == null && (childRootInfo = this.rootInfo(childPath, childKind)) != null)) {
+ this.traverseDelta(child, IRubyElement.SOURCE_FOLDER_ROOT, childRootInfo); // binary output of childRootInfo.project cannot be this root
+ }
+
+ // if the child is a package fragment root of one or several other projects
+ ArrayList rootList;
+ if ((rootList = this.otherRootsInfo(childPath, childKind)) != null) {
+ Iterator iterator = rootList.iterator();
+ while (iterator.hasNext()) {
+ childRootInfo = (RootInfo) iterator.next();
+ this.traverseDelta(child, IRubyElement.SOURCE_FOLDER_ROOT, childRootInfo); // binary output of childRootInfo.project cannot be this root
+ }
+ }
+ }
+ if (orphanChildren != null && (oneChildOnLoadpath // orphan
// children are
// siblings of a
// package
// fragment root
- || res instanceof IProject)) { // non-java resource
+ || res instanceof IProject)) { // non-ruby resource
// directly under a project
// attach orphan children
@@ -1195,7 +1287,17 @@
} // else resource delta will be added by parent
}
- /*
+ /*
+ * Returns the other root infos for the given path. Look in the old other roots table if kind is REMOVED.
+ */
+ private ArrayList otherRootsInfo(IPath path, int kind) {
+ if (kind == IResourceDelta.REMOVED) {
+ return (ArrayList)this.state.oldOtherRoots.get(path);
+ }
+ return (ArrayList)this.state.otherRoots.get(path);
+ }
+
+ /*
* Update the current delta (ie. add/remove/change the given element) and
* update the correponding index. Returns whether the children of the given
* delta must be processed. @throws a RubyModelException if the delta
@@ -1490,8 +1592,9 @@
}
// find the element type of the moved from element
+ RootInfo movedFromInfo = this.enclosingRootInfo(movedFromPath, IResourceDelta.REMOVED);
int movedFromType = this.elementType(movedFromRes, IResourceDelta.REMOVED, element
- .getParent().getElementType());
+ .getParent().getElementType(), movedFromInfo);
// reset current element as it might be inside a nested root
// (popUntilPrefixOf() may use the outer root)
@@ -1586,8 +1689,9 @@
}
// find the element type of the moved from element
+ RootInfo movedToInfo = this.enclosingRootInfo(movedToPath, IResourceDelta.ADDED);
int movedToType = this.elementType(movedToRes, IResourceDelta.ADDED, element
- .getParent().getElementType());
+ .getParent().getElementType(), movedToInfo);
// reset current element as it might be inside a nested root
// (popUntilPrefixOf() may use the outer root)
@@ -1672,28 +1776,59 @@
* NON_RUBY_RESOURCE if unknown (e.g. a non-ruby resource or excluded .rb
* file)
*/
- private int elementType(IResource res, int kind, int parentType) {
- switch (parentType) {
- case IRubyElement.RUBY_MODEL:
- // case of a movedTo or movedFrom project (other cases are handled
- // in processResourceDelta(...)
- return IRubyElement.RUBY_PROJECT;
+ private int elementType(IResource res, int kind, int parentType, RootInfo rootInfo) {
+ switch (parentType) {
+ case IRubyElement.RUBY_MODEL:
+ // case of a movedTo or movedFrom project (other cases are handled in processResourceDelta(...)
+ return IRubyElement.RUBY_PROJECT;
+
+ case NON_RUBY_RESOURCE:
+ case IRubyElement.RUBY_PROJECT:
+ if (rootInfo == null) {
+ rootInfo = this.enclosingRootInfo(res.getFullPath(), kind);
+ }
+ if (rootInfo != null && rootInfo.isRootOfProject(res.getFullPath())) {
+ return IRubyElement.SOURCE_FOLDER_ROOT;
+ }
+ // not yet in a source folder root or root of another project
+ // or source folder to be included (see below)
+ // -> let it go through
- case NON_RUBY_RESOURCE:
- case IRubyElement.RUBY_PROJECT:
- if (res.getType() == IResource.FOLDER) { return NON_RUBY_RESOURCE; }
- String fileName = res.getName();
- if (Util.isValidRubyScriptName(fileName)) {
- return IRubyElement.SCRIPT;
- } else {
- return NON_RUBY_RESOURCE;
- }
+ case IRubyElement.SOURCE_FOLDER_ROOT:
+ case IRubyElement.SOURCE_FOLDER:
+ if (rootInfo == null) {
+ rootInfo = this.enclosingRootInfo(res.getFullPath(), kind);
+ }
+ if (rootInfo == null) {
+ return NON_RUBY_RESOURCE;
+ }
+ if (Util.isExcluded(res, rootInfo.inclusionPatterns, rootInfo.exclusionPatterns)) {
+ return NON_RUBY_RESOURCE;
+ }
+ if (res.getType() == IResource.FOLDER) {
+ if (parentType == NON_RUBY_RESOURCE && !Util.isExcluded(res.getParent(), rootInfo.inclusionPatterns, rootInfo.exclusionPatterns))
+ // parent is a non-Ruby resource because it doesn't have a valid package name (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=130982)
+ return NON_RUBY_RESOURCE;
+// if (Util.isValidFolderNameForPackage(res.getName())) {
+ return IRubyElement.SOURCE_FOLDER;
+// }
+// return NON_RUBY_RESOURCE;
+ }
+ String fileName = res.getName();
+ if (Util.isValidRubyScriptName(fileName)) {
+ return IRubyElement.SCRIPT;
+ } else if (this.rootInfo(res.getFullPath(), kind) != null) {
+ // case of proj=src=bin and resource is a jar file on the classpath
+ return IRubyElement.SOURCE_FOLDER_ROOT;
+ } else {
+ return NON_RUBY_RESOURCE;
+ }
+
+ default:
+ return NON_RUBY_RESOURCE;
+ }
+ }
- default:
- return NON_RUBY_RESOURCE;
- }
- }
-
/*
* Answer a combination of the lastModified stamp and the size.
* Used for detecting external JAR changes
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRoot.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRoot.java 2007-01-30 20:35:57 UTC (rev 1896)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRoot.java 2007-01-31 14:39:18 UTC (rev 1897)
@@ -144,9 +144,9 @@
}
/**
- * Compute the package fragment children of this package fragment root.
+ * Compute the source folder children of this source folder root.
*
- * @exception JavaModelException The resource associated with this package fragment root does not exist
+ * @exception RubyModelException The resource associated with this source folder root does not exist
*/
protected boolean computeChildren(OpenableElementInfo info, Map newElements) throws RubyModelException {
try {
@@ -193,10 +193,10 @@
*/
protected void computeFolderChildren(IContainer folder, String[] pkgName, ArrayList vChildren) throws RubyModelException {
ISourceFolder pkg = getSourceFolder(pkgName);
- vChildren.add(pkg);
+ vChildren.add(pkg); // add ourself
try {
- RubyProject javaProject = (RubyProject)getRubyProject();
+ RubyProject rubyProject = (RubyProject)getRubyProject();
RubyModelManager manager = RubyModelManager.getRubyModelManager();
IResource[] members = folder.members();
@@ -206,13 +206,10 @@
switch(member.getType()) {
case IResource.FOLDER:
- if (javaProject.contains(member)) {
+ if (rubyProject.contains(member)) {
String[] newNames = Util.arrayConcat(pkgName, manager.intern(memberName));
computeFolderChildren((IFolder) member, newNames, vChildren);
- ISourceFolder child = getSourceFolder(newNames);
- vChildren.add(child);
}
-
break;
case IResource.FILE:
// inclusion filter may only include files, in which case we still want to include the immediate parent package (lazily)
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/NewWizardMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/NewWizardMessages.properties 2007-01-30 20:35:57 UTC (rev 1896)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/NewWizardMessages.properties 2007-01-31 14:39:18 UTC (rev 1897)
@@ -50,7 +50,7 @@
NewTypeWizardPage_error_EnterTypeName=Type name is empty.
NewTypeWizardPage_package_button=Bro&wse...
-NewTypeWizardPage_package_label=Pac&kage:
+NewTypeWizardPage_package_label=Folder:
NewTypeWizardPage_ChoosePackageDialog_title=Package Selection
NewTypeWizardPage_ChoosePackageDialog_description=&Choose a folder:
NewTypeWizardPage_ChoosePackageDialog_empty=Cannot find packages to select.
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewClassWizardPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewClassWizardPage.java 2007-01-30 20:35:57 UTC (rev 1896)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewClassWizardPage.java 2007-01-31 14:39:18 UTC (rev 1897)
@@ -37,13 +37,12 @@
* To implement a different kind of a new class wizard page, extend <code>NewTypeWizardPage</code>.
* </p>
*
- * @since 2.0
+ * @since 0.9.0
*/
public class NewClassWizardPage extends NewTypeWizardPage {
private final static String PAGE_NAME= "NewClassWizardPage"; //$NON-NLS-1$
- private final static String SETTINGS_CREATEMAIN= "create_main"; //$NON-NLS-1$
private final static String SETTINGS_CREATECONSTR= "create_constructor"; //$NON-NLS-1$
private SelectionButtonDialogFieldGroup fMethodStubsButtons;
@@ -58,7 +57,7 @@
setDescription(NewWizardMessages.NewClassWizardPage_description);
String[] buttonNames3= new String[] {
- NewWizardMessages.NewClassWizardPage_methods_main, NewWizardMessages.NewClassWizardPage_methods_constructors
+ NewWizardMessages.NewClassWizardPage_methods_constructors
};
fMethodStubsButtons= new SelectionButtonDialogFieldGroup(SWT.CHECK, buttonNames3, 1);
fMethodStubsButtons.setLabelText(NewWizardMessages.NewClassWizardPage_methods_label);
@@ -79,19 +78,17 @@
initTypePage(jelem);
doStatusUpdate();
- boolean createMain= false;
boolean createConstructors= false;
boolean createUnimplemented= true;
IDialogSettings dialogSettings= getDialogSettings();
if (dialogSettings != null) {
IDialogSettings section= dialogSettings.getSection(PAGE_NAME);
if (section != null) {
- createMain= section.getBoolean(SETTINGS_CREATEMAIN);
createConstructors= section.getBoolean(SETTINGS_CREATECONSTR);
}
}
- setMethodStubSelection(createMain, createConstructors, true);
+ setMethodStubSelection(createConstructors, true);
}
// ------ validation --------
@@ -175,7 +172,6 @@
if (section == null) {
section= dialogSettings.addNewSection(PAGE_NAME);
}
- section.put(SETTINGS_CREATEMAIN, isCreateMain());
section.put(SETTINGS_CREATECONSTR, isCreateConstructors());
}
}
@@ -192,21 +188,12 @@
}
/**
- * Returns the current selection state of the 'Create Main' checkbox.
- *
- * @return the selection state of the 'Create Main' checkbox
- */
- public boolean isCreateMain() {
- return fMethodStubsButtons.isSelected(0);
- }
-
- /**
* Returns the current selection state of the 'Create Constructors' checkbox.
*
* @return the selection state of the 'Create Constructors' checkbox
*/
public boolean isCreateConstructors() {
- return fMethodStubsButtons.isSelected(1);
+ return fMethodStubsButtons.isSelected(0);
}
/**
@@ -217,9 +204,8 @@
* @param canBeModified if <code>true</code> the method stub checkboxes can be changed by
* the user. If <code>false</code> the buttons are "read-only"
*/
- public void setMethodStubSelection(boolean createMain, boolean createConstructors, boolean canBeModified) {
- fMethodStubsButtons.setSelection(0, createMain);
- fMethodStubsButtons.setSelection(1, createConstructors);
+ public void setMethodStubSelection(boolean createConstructors, boolean canBeModified) {
+ fMethodStubsButtons.setSelection(0, createConstructors);
fMethodStubsButtons.setEnabled(canBeModified);
}
@@ -230,8 +216,6 @@
* @see NewTypeWizardPage#createTypeMembers
*/
protected void createTypeMembers(IType type, IProgressMonitor monitor) throws CoreException {
-// boolean doMain= isCreateMain();
- // TODO Create a main method?!
boolean doConstr= isCreateConstructors();
if (doConstr) {
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewContainerWizardPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewContainerWizardPage.java 2007-01-30 20:35:57 UTC (rev 1896)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewContainerWizardPage.java 2007-01-31 14:39:18 UTC (rev 1897)
@@ -284,9 +284,8 @@
}
/**
- * Sets the current source folder (model and text field) to the given package
- * fragment root.
-
+ * Sets the current source folder (model and text field) to the given source folder
+ * root.
* @param root The new root.
* @param canBeModified if <code>false</code> the source folder field can
* not be changed by the user. If <code>true</code> the field is editable
@@ -381,7 +380,7 @@
* Clients can override this method if they want to offer a different dialog.
* </p>
*
- * @since 3.2
+ * @since 0.9.0
*/
protected ISourceFolderRoot chooseContainer() {
IRubyElement initElement= getSourceFolderRoot();
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java 2007-01-30 20:35:57 UTC (rev 1896)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java 2007-01-31 14:39:18 UTC (rev 1897)
@@ -435,7 +435,7 @@
* Clients can override this method if they want to offer a different dialog.
* </p>
*
- * @since 3.2
+ * @since 0.9.0
*/
protected ISourceFolder chooseSourceFolder() {
ISourceFolderRoot froot= getSourceFolderRoot();
@@ -539,10 +539,10 @@
}
/**
- * Sets the package fragment to the given value. The method updates the model
+ * Sets the source folder to the given value. The method updates the model
* and the text of the control.
*
- * @param pack the package fragment to be set
+ * @param pack the source folder to be set
* @param canBeModified if <code>true</code> the package fragment is
* editable; otherwise it is read-only.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-30 20:36:07
|
Revision: 1896
http://svn.sourceforge.net/rubyeclipse/?rev=1896&view=rev
Author: cawilliams
Date: 2007-01-30 12:35:57 -0800 (Tue, 30 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java 2007-01-29 19:17:22 UTC (rev 1895)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java 2007-01-30 20:35:57 UTC (rev 1896)
@@ -78,13 +78,19 @@
public static final String ID_ELEMENT_CREATION_ACTION_SET = "org.rubypeople.rdt.ui.RubyElementCreationActionSet"; //$NON-NLS-1$
/**
+ * The id of the Ruby perspective
+ * (value <code>"org.rubypeople.rdt.ui.PerspectiveRuby"</code>).
+ */
+ public static final String ID_PERSPECTIVE= "org.rubypeople.rdt.ui.PerspectiveRuby"; //$NON-NLS-1$
+
+ /**
* Returns the Ruby element wrapped by the given editor input.
*
* @param editorInput
* the editor input
* @return the Ruby element wrapped by <code>editorInput</code> or
* <code>null</code> if none
- * @since 3.2
+ * @since 0.9.0
*/
public static IRubyElement getEditorInputRubyElement(
IEditorInput editorInput) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-29 19:17:33
|
Revision: 1895
http://svn.sourceforge.net/rubyeclipse/?rev=1895&view=rev
Author: cawilliams
Date: 2007-01-29 11:17:22 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
add experimental code to try and detect the default vms set up on *nix boxes (including Mac OSX). Calls out to "which ruby" and parses the answer for a Standard VM Type. (Need to have it handle a non path response!)
Modified Paths:
--------------
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
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMListener.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-01-29 16:02:24 UTC (rev 1894)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-01-29 19:17:22 UTC (rev 1895)
@@ -13,12 +13,14 @@
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;
@@ -229,4 +231,79 @@
return paths;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.launching.IVMInstallType#detectInstallLocation()
+ */
+ public File detectInstallLocation() {
+ // do not detect on Windows
+ if (Platform.getOS().equals(Constants.OS_WIN32)) {
+ return null;
+ }
+
+ String[] cmdLine = new String[] { "which", "ruby" }; //$NON-NLS-1$ //$NON-NLS-2$
+ Process p = null;
+ File rubyExecutable = null;
+ try {
+ p = Runtime.getRuntime().exec(cmdLine);
+ IProcess process = DebugPlugin.newProcess(new Launch(null, ILaunchManager.RUN_MODE, null), p, "Standard Ruby 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 (rubyExecutable == null) {
+ return null;
+ }
+
+ File bin= new File(rubyExecutable.getParent());
+ if (!bin.exists()) return null;
+ File rubyHome = bin.getParentFile();
+ if (!rubyHome.exists()) return null;
+ if (!canDetectDefaultSystemLibraries(rubyHome, rubyExecutable)) {
+ return null;
+ }
+
+ return rubyHome;
+ }
+
+ /**
+ * 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;
+ }
+
}
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMListener.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMListener.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMListener.java 2007-01-29 19:17:22 UTC (rev 1895)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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.launching;
+
+import org.rubypeople.rdt.launching.IVMInstall;
+import org.rubypeople.rdt.launching.IVMInstallChangedListener;
+import org.rubypeople.rdt.launching.PropertyChangeEvent;
+
+/**
+ * Simple VM listener that reports whether VM settings have changed.
+ *
+ * @since 0.9.0
+ *
+ */
+public class VMListener implements IVMInstallChangedListener {
+
+ private boolean fChanged = false;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.launching.IVMInstallChangedListener#defaultVMInstallChanged(org.eclipse.jdt.launching.IVMInstall, org.eclipse.jdt.launching.IVMInstall)
+ */
+ public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {
+ fChanged = true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.launching.IVMInstallChangedListener#vmAdded(org.eclipse.jdt.launching.IVMInstall)
+ */
+ public void vmAdded(IVMInstall vm) {
+ fChanged = true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.launching.IVMInstallChangedListener#vmChanged(org.eclipse.jdt.launching.PropertyChangeEvent)
+ */
+ public void vmChanged(PropertyChangeEvent event) {
+ fChanged = true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.launching.IVMInstallChangedListener#vmRemoved(org.eclipse.jdt.launching.IVMInstall)
+ */
+ public void vmRemoved(IVMInstall vm) {
+ fChanged = true;
+ }
+
+ public boolean isChanged() {
+ return fChanged;
+ }
+
+}
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-01-29 16:02:24 UTC (rev 1894)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallType.java 2007-01-29 19:17:22 UTC (rev 1895)
@@ -7,22 +7,104 @@
public interface IVMInstallType {
+ /**
+ * Finds the VM with the given name.
+ *
+ * @param name the VM name
+ * @return a VM instance, or <code>null</code> if not found
+ * @since 0.9.0
+ */
IVMInstall findVMInstallByName(String vmName);
+ /**
+ * Returns the globally unique id of this VM type.
+ * Clients are responsible for providing a unique id.
+ *
+ * @return the id of this IVMInstallType
+ */
String getId();
+ /**
+ * Returns all VM instances managed by this VM type.
+ *
+ * @return the list of VM instances managed by this VM type
+ */
IVMInstall[] getVMInstalls();
+ /**
+ * Validates the given location of a VM installation.
+ * <p>
+ * For example, an implementation might check whether the VM executable
+ * is present.
+ * </p>
+ *
+ * @param installLocation the root directory of a potential installation for
+ * this type of VM
+ * @return a status object describing whether the install location is valid
+ */
IStatus validateInstallLocation(File installLocation);
+ /**
+ * Finds the VM with the given id.
+ *
+ * @param id the VM id
+ * @return a VM instance, or <code>null</code> if not found
+ */
IVMInstall findVMInstall(String id);
+ /**
+ * Returns a collection of <code>IPath</code>s that represent the
+ * default system libraries of this VM install type, if a VM was installed
+ * at the given <code>installLocation</code>.
+ * The returned <code>IPath</code>s may not exist if the
+ * <code>installLocation</code> is not a valid install location.
+ *
+ * @param installLocation home location
+ * @see IVMInstallType#validateInstallLocation(File)
+ *
+ * @return default library locations based on the given <code>installLocation</code>.
+ * @since 0.9.0
+ */
IPath[] getDefaultLibraryLocations(File installLocation);
+ /**
+ * Returns the display name of this VM type.
+ *
+ * @return the name of this IVMInstallType
+ */
String getName();
+ /**
+ * Remove the VM associated with the given id from the set of VMs managed by
+ * this VM type. Has no effect if a VM with the given id is not currently managed
+ * by this type.
+ * A VM install that is disposed may not be used anymore.
+ *
+ * @param id the id of the VM to be disposed.
+ */
void disposeVMInstall(String id);
+ /**
+ * Creates a new instance of this VM Install type.
+ * The newly created IVMInstall is managed by this IVMInstallType.
+ *
+ * @param id An id String that must be unique within this IVMInstallType.
+ *
+ * @return the newly created VM instance
+ *
+ * @throws IllegalArgumentException If the id exists already.
+ */
IVMInstall createVMInstall(String id);
+
+ /**
+ * Tries to detect an installed VM that matches this VM install type.
+ * Typically, this method will detect the VM installation found by "which ruby" on *nix systems.
+ * Implementers should return <code>null</code> if they
+ * can't assure that a given vm install matches this IVMInstallType.
+ * @return The location of an VM installation that can be used
+ * with this VM install type, or <code>null</code> if unable
+ * to locate an installed VM.
+ */
+ public File detectInstallLocation();
}
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-01-29 16:02:24 UTC (rev 1894)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-29 19:17:22 UTC (rev 1895)
@@ -49,6 +49,7 @@
import org.rubypeople.rdt.internal.launching.RuntimeLoadpathEntryResolver;
import org.rubypeople.rdt.internal.launching.RuntimeLoadpathProvider;
import org.rubypeople.rdt.internal.launching.VMDefinitionsContainer;
+import org.rubypeople.rdt.internal.launching.VMListener;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -329,10 +330,30 @@
vmDefs = new VMDefinitionsContainer();
// 2. add persisted VMs
setPref = addPersistedVMs(vmDefs);
-
- // 3. load contributed VM installs
+// 3. if there are none, detect the eclipse runtime
+ if (vmDefs.getValidVMList().isEmpty()) {
+ // calling out to detectDefaultVMs() could allow clients to change
+ // VM settings (i.e. call back into change VM settings).
+ VMListener listener = new VMListener();
+ addVMInstallChangedListener(listener);
+ setPref = true;
+ VMStandin runtime = detectDefaultVMs();
+ removeVMInstallChangedListener(listener);
+ if (!listener.isChanged()) {
+ if (runtime != null) {
+ vmDefs.addVM(runtime);
+ vmDefs.setDefaultVMInstallCompositeID(getCompositeIdFromVM(runtime));
+ }
+ } else {
+ // VMs were changed - reflect current settings
+ addPersistedVMs(vmDefs);
+ vmDefs.setDefaultVMInstallCompositeID(fgDefaultVMId);
+
+ }
+ }
+ // 4. load contributed VM installs
addVMExtensions(vmDefs);
- // 4. verify default VM is valid
+ // 5. verify default VM is valid
String defId = vmDefs.getDefaultVMInstallCompositeID();
boolean validDef = false;
if (defId != null) {
@@ -402,6 +423,45 @@
}
/**
+ * Detect the VM that is used by the system by default.
+ *
+ * @return a VM standin representing the VM that Eclipse is running on, or
+ * <code>null</code> if unable to detect the runtime VM
+ */
+ private static VMStandin detectDefaultVMs() {
+ VMStandin detectedVMStandin = null;
+ // Try to detect a VM for each declared VM type
+ IVMInstallType[] vmTypes= getVMInstallTypes();
+ for (int i = 0; i < vmTypes.length; i++) {
+
+ File detectedLocation= vmTypes[i].detectInstallLocation();
+ if (detectedLocation != null && detectedVMStandin == null) {
+
+ // Make sure the VM id is unique
+ long unique = System.currentTimeMillis();
+ IVMInstallType vmType = vmTypes[i];
+ while (vmType.findVMInstall(String.valueOf(unique)) != null) {
+ unique++;
+ }
+
+ // Create a standin for the detected VM and add it to the result collector
+ String vmID = String.valueOf(unique);
+ detectedVMStandin = new VMStandin(vmType, vmID);
+ detectedVMStandin.setInstallLocation(detectedLocation);
+ detectedVMStandin.setName(generateDetectedVMName(detectedVMStandin));
+ }
+ }
+ return detectedVMStandin;
+ }
+
+ /**
+ * Make the name of a detected VM stand out.
+ */
+ private static String generateDetectedVMName(IVMInstall vm) {
+ return vm.getInstallLocation().getName();
+ }
+
+ /**
* Initializes vm type extensions.
*/
private static void initializeVMTypeExtensions() {
@@ -485,7 +545,7 @@
*
* @param vm the instance of IVMInstallType to be identified
*
- * @since 2.1
+ * @since 0.9.0
*/
public static String getCompositeIdFromVM(IVMInstall vm) {
if (vm == null) {
@@ -499,7 +559,7 @@
/**
* Loads contributed VM installs
- * @since 3.2
+ * @since 0.9.0
*/
private static void addVMExtensions(VMDefinitionsContainer vmDefs) {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(LaunchingPlugin.PLUGIN_ID, RubyRuntime.EXTENSION_POINT_VM_INSTALLS);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-29 16:02:26
|
Revision: 1894
http://svn.sourceforge.net/rubyeclipse/?rev=1894&view=rev
Author: cawilliams
Date: 2007-01-29 08:02:24 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
work out some of the kinks in hooking up the core library stubs...
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/core/RubyProject.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
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-01-29 14:55:03 UTC (rev 1893)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-01-29 16:02:24 UTC (rev 1894)
@@ -90,15 +90,11 @@
if (this.prefix != null)
replaceStart -= this.prefix.length();
- // TODO Refactor out common code here...
- if (this.prefix != null && this.prefix.length() == 0) { // empty prefix
+ if (isConstant() || (emptyPrefix() && !isMethod)) { // type, constant, or empty prefix (with no preceding period)
suggestTypeNames(replaceStart);
suggestConstantNames(replaceStart);
- getDocumentsRubyElementsInScope(script, source.toString(), offset, replaceStart);
- } else if (isConstant()) { // type or constant
- suggestTypeNames(replaceStart);
- suggestConstantNames(replaceStart);
- } else { // method or variable
+ }
+ if (isMethod) { // method
ITypeInferrer inferrer = new DefaultTypeInferrer();
List<ITypeGuess> guesses = inferrer.infer(source.toString(), offset);
RubyElementRequestor requestor = new RubyElementRequestor(script);
@@ -109,13 +105,17 @@
suggestMethods(replaceStart, guess.getConfidence(), types[i]);
}
}
- // FIXME Traverse the IRubyElement model, not nodes (and don't reparse!)
- if (!isMethod)
- getDocumentsRubyElementsInScope(script, source.toString(), offset, replaceStart);
}
+ // FIXME Traverse the IRubyElement model, not nodes (and don't reparse!)
+ if (!isMethod)
+ getDocumentsRubyElementsInScope(script, source.toString(), offset, replaceStart);
this.requestor.endReporting();
}
+ private boolean emptyPrefix() {
+ return this.prefix != null && this.prefix.length() == 0;
+ }
+
private void suggestTypeNames(int replaceStart) {
List<String> types = ExperimentalIndex.getTypes();
// TODO Remove duplicates? Sort?
@@ -146,7 +146,7 @@
}
private boolean isConstant() {
- return this.prefix != null && this.prefix.length() > 0 && Character.isUpperCase(this.prefix.charAt(0));
+ return prefix != null && prefix.length() > 0 && Character.isUpperCase(prefix.charAt(0));
}
private void suggestMethods(int replaceStart, int confidence, IType type) throws RubyModelException {
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-01-29 14:55:03 UTC (rev 1893)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java 2007-01-29 16:02:24 UTC (rev 1894)
@@ -4,6 +4,7 @@
import java.util.List;
import java.util.StringTokenizer;
+import org.eclipse.core.runtime.IPath;
import org.rubypeople.rdt.core.IImportDeclaration;
import org.rubypeople.rdt.core.IParent;
import org.rubypeople.rdt.core.IRubyElement;
@@ -29,9 +30,10 @@
List<IType> types = new ArrayList<IType>();
IRubyProject rubyProject = script.getRubyProject();
try {
+ // FIXME Search the roots in a particular order? Return first match?
ISourceFolderRoot[] roots = rubyProject.getSourceFolderRoots();
for (int i = 0; i < roots.length; i++) {
- types.addAll(getTypeInSourceFolderRoot(roots[i]));
+ types.addAll(getTypeInSourceFolderRoot(roots[i], typeName));
}
} catch (RubyModelException e) {
RubyCore.log(e);
@@ -43,20 +45,34 @@
return (IType[]) types.toArray(new IType[matches.size()]);
}
- private List<IType> getTypeInSourceFolderRoot(ISourceFolderRoot root) {
+ private List<IType> getTypeInSourceFolderRoot(ISourceFolderRoot root, String typeName) {
List<IType> types = new ArrayList<IType>();
try {
- IImportDeclaration[] imports = script.getImports();
- for (int j = 0; j < imports.length; j++) {
- types.addAll(getTypeInImport(root, imports[j]));
+ IPath rootPath = root.getPath();
+// FIXME this is an ugly hack to search the core library in a special way (no need to look at imports)
+ if (rootPath.toString().contains("org.rubypeople.rdt.launching")) {
+ types.addAll(getTypeInImport(root, typeName.toLowerCase()));
+ } else {
+ IImportDeclaration[] imports = script.getImports();
+ for (int j = 0; j < imports.length; j++) {
+ String path = imports[j].getElementName();
+ types.addAll(getTypeInImport(root, path));
+ }
}
} catch (RubyModelException e) {
RubyCore.log(e);
}
return types;
}
- private List<IType> getTypeInImport(ISourceFolderRoot root, IImportDeclaration importDecl) {
- String path = importDecl.getElementName();
+
+ /**
+ * Searches the root for the path given (and appends the typical ".rb" extension).
+ * If we find a match, grab the types inside the script.
+ * @param root The ISourceFolderRoot to search
+ * @param path The internal path to search.
+ * @return a List of ITypes which seem to be a match
+ */
+ private List<IType> getTypeInImport(ISourceFolderRoot root, String path) {
StringTokenizer tokenizer = new StringTokenizer(path, SEPARATOR_CHARS);
List<String> tokens = new ArrayList<String>();
while(tokenizer.hasMoreTokens()) {
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-01-29 14:55:03 UTC (rev 1893)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-01-29 16:02:24 UTC (rev 1894)
@@ -556,7 +556,7 @@
* boolean
* @param retrieveExportedRoots
* boolean
- * @throws JavaModelException
+ * @throws RubyModelException
*/
public void computeSourceFolderRoots(ILoadpathEntry resolvedEntry, ObjectVector accumulatedRoots, HashSet rootIDs, ILoadpathEntry referringEntry, boolean checkExistency, boolean retrieveExportedRoots, Map rootToResolvedEntries) throws RubyModelException {
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-01-29 14:55:03 UTC (rev 1893)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java 2007-01-29 16:02:24 UTC (rev 1894)
@@ -18,7 +18,10 @@
public class StandardVM extends AbstractVMInstall {
- private String fgSeparator;
+ /**
+ * 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);
@@ -65,6 +68,13 @@
}
return null;
}
+
+ @Override
+ public IPath[] getLibraryLocations() {
+ IPath[] paths = super.getLibraryLocations();
+ if (paths != null) return paths;
+ return getDefaultLibraryLocations();
+ }
@Override
public void setLibraryLocations(IPath[] locations) {
@@ -102,13 +112,16 @@
private IPath[] getDefaultLibraryLocations() {
IPath[] dflts = getVMInstallType().getDefaultLibraryLocations(getInstallLocation());
+ IPath coreStubsPath = generateCoreStubs(StandardVMType.findRubyExecutable(getInstallLocation()));
+ if (coreStubsPath == null) {
+ return dflts;
+ }
IPath[] paths = new IPath[dflts.length + 1];
for (int i = 0; i < dflts.length; i++) {
paths[i] = dflts[i];
}
- // FIXME Handle possible null pointer being returned by findRubyExecutable
- paths[dflts.length] = generateCoreStubs(StandardVMType.findRubyExecutable(getInstallLocation()));
- return dflts;
+ paths[dflts.length] = coreStubsPath;
+ return paths;
}
/**
@@ -118,14 +131,15 @@
* @return an IPath pointing to the directory containing the core library stubs
*/
private IPath generateCoreStubs(File rubyExecutable) {
+ if (rubyExecutable == null) return null;
//locate the script to generate our core stubs
- File file = LaunchingPlugin.getFileInPlugin(new Path("ruby" + fgSeparator + "core_stubber.rb")); //$NON-NLS-1$
- IPath path = new Path(file.getParentFile().getAbsolutePath() + fgSeparator + getId() + fgSeparator + "lib"); //$NON-NLS-1$
- if (path.toFile().exists()) {
- return path; // we've already created the stubs for this VM
- }
- path.toFile().mkdirs(); // Make the directory structure to throw the files into
+ File file = LaunchingPlugin.getFileInPlugin(new Path("ruby/core_stubber.rb")); //$NON-NLS-1$
if (file.exists()) {
+ IPath path = new Path(file.getParentFile().getAbsolutePath() + fgSeparator + getId() + fgSeparator + "lib"); //$NON-NLS-1$
+ if (path.toFile().exists()) {
+ return path; // we've already created the stubs for this VM
+ }
+ path.toFile().mkdirs(); // Make the directory structure to throw the files into
String rubyExecutablePath = rubyExecutable.getAbsolutePath();
String[] cmdLine = new String[] {rubyExecutablePath, file.getAbsolutePath(), path.toOSString()};
Process p = null;
@@ -141,7 +155,8 @@
Thread.sleep(50);
} catch (InterruptedException e) {
}
- }
+ }
+ return path;
} catch (IOException ioe) {
LaunchingPlugin.log(ioe);
} finally {
@@ -150,6 +165,6 @@
}
}
}
- return path;
+ return null;
}
}
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-01-29 14:55:03 UTC (rev 1893)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-01-29 16:02:24 UTC (rev 1894)
@@ -138,7 +138,7 @@
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" + fgSeparator + "loadpath.rb")); //$NON-NLS-1$
+ File file = LaunchingPlugin.getFileInPlugin(new Path("ruby/loadpath.rb")); //$NON-NLS-1$
if (file.exists()) {
String rubyExecutablePath = rubyExecutable.getAbsolutePath();
String[] cmdLine = new String[] {rubyExecutablePath, file.getAbsolutePath()}; //$NON-NLS-1$
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-29 14:55:07
|
Revision: 1893
http://svn.sourceforge.net/rubyeclipse/?rev=1893&view=rev
Author: cawilliams
Date: 2007-01-29 06:55:03 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
no longer need these stubs. We now use a script to generate stubs on demand for VMs
Removed Paths:
-------------
trunk/org.rubypeople.rdt.core/ruby/lib/argumenterror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/array.rb
trunk/org.rubypeople.rdt.core/ruby/lib/bignum.rb
trunk/org.rubypeople.rdt.core/ruby/lib/binding.rb
trunk/org.rubypeople.rdt.core/ruby/lib/buffering.rb
trunk/org.rubypeople.rdt.core/ruby/lib/class.rb
trunk/org.rubypeople.rdt.core/ruby/lib/comparable.rb
trunk/org.rubypeople.rdt.core/ruby/lib/config.rb
trunk/org.rubypeople.rdt.core/ruby/lib/continuation.rb
trunk/org.rubypeople.rdt.core/ruby/lib/data.rb
trunk/org.rubypeople.rdt.core/ruby/lib/date.rb
trunk/org.rubypeople.rdt.core/ruby/lib/datetime.rb
trunk/org.rubypeople.rdt.core/ruby/lib/digest.rb
trunk/org.rubypeople.rdt.core/ruby/lib/dir.rb
trunk/org.rubypeople.rdt.core/ruby/lib/enumerable.rb
trunk/org.rubypeople.rdt.core/ruby/lib/eoferror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/errno.rb
trunk/org.rubypeople.rdt.core/ruby/lib/exception.rb
trunk/org.rubypeople.rdt.core/ruby/lib/falseclass.rb
trunk/org.rubypeople.rdt.core/ruby/lib/file.rb
trunk/org.rubypeople.rdt.core/ruby/lib/filetest.rb
trunk/org.rubypeople.rdt.core/ruby/lib/fileutils.rb
trunk/org.rubypeople.rdt.core/ruby/lib/fixnum.rb
trunk/org.rubypeople.rdt.core/ruby/lib/float.rb
trunk/org.rubypeople.rdt.core/ruby/lib/floatdomainerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/forwardable.rb
trunk/org.rubypeople.rdt.core/ruby/lib/gc.rb
trunk/org.rubypeople.rdt.core/ruby/lib/gem.rb
trunk/org.rubypeople.rdt.core/ruby/lib/hash.rb
trunk/org.rubypeople.rdt.core/ruby/lib/indexerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/integer.rb
trunk/org.rubypeople.rdt.core/ruby/lib/interrupt.rb
trunk/org.rubypeople.rdt.core/ruby/lib/io.rb
trunk/org.rubypeople.rdt.core/ruby/lib/ioerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/kernel.rb
trunk/org.rubypeople.rdt.core/ruby/lib/loaderror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/localjumperror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/marshal.rb
trunk/org.rubypeople.rdt.core/ruby/lib/matchdata.rb
trunk/org.rubypeople.rdt.core/ruby/lib/math.rb
trunk/org.rubypeople.rdt.core/ruby/lib/method.rb
trunk/org.rubypeople.rdt.core/ruby/lib/module.rb
trunk/org.rubypeople.rdt.core/ruby/lib/nameerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/nilclass.rb
trunk/org.rubypeople.rdt.core/ruby/lib/nomemoryerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/nomethoderror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/notimplementederror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/numeric.rb
trunk/org.rubypeople.rdt.core/ruby/lib/object.rb
trunk/org.rubypeople.rdt.core/ruby/lib/objectspace.rb
trunk/org.rubypeople.rdt.core/ruby/lib/openssl.rb
trunk/org.rubypeople.rdt.core/ruby/lib/parsedate.rb
trunk/org.rubypeople.rdt.core/ruby/lib/precision.rb
trunk/org.rubypeople.rdt.core/ruby/lib/proc.rb
trunk/org.rubypeople.rdt.core/ruby/lib/process.rb
trunk/org.rubypeople.rdt.core/ruby/lib/range.rb
trunk/org.rubypeople.rdt.core/ruby/lib/rangeerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/rational.rb
trunk/org.rubypeople.rdt.core/ruby/lib/regexp.rb
trunk/org.rubypeople.rdt.core/ruby/lib/regexperror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/runtimeerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/scripterror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/securityerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/signal.rb
trunk/org.rubypeople.rdt.core/ruby/lib/signalexception.rb
trunk/org.rubypeople.rdt.core/ruby/lib/singleforwardable.rb
trunk/org.rubypeople.rdt.core/ruby/lib/standarderror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/string.rb
trunk/org.rubypeople.rdt.core/ruby/lib/struct.rb
trunk/org.rubypeople.rdt.core/ruby/lib/symbol.rb
trunk/org.rubypeople.rdt.core/ruby/lib/syntaxerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/systemcallerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/systemexit.rb
trunk/org.rubypeople.rdt.core/ruby/lib/systemstackerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/thread.rb
trunk/org.rubypeople.rdt.core/ruby/lib/threaderror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/threadgroup.rb
trunk/org.rubypeople.rdt.core/ruby/lib/time.rb
trunk/org.rubypeople.rdt.core/ruby/lib/trueclass.rb
trunk/org.rubypeople.rdt.core/ruby/lib/typeerror.rb
trunk/org.rubypeople.rdt.core/ruby/lib/unboundmethod.rb
trunk/org.rubypeople.rdt.core/ruby/lib/zerodivisionerror.rb
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/argumenterror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/argumenterror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/argumenterror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class ArgumentError < StandardError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/array.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/array.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/array.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,148 +0,0 @@
-class Array < Object
- include Enumerable
-
- def self.[](arg0, arg1, *rest)
- end
- def concat(arg0)
- end
- def delete_at(arg0)
- end
- def include?(arg0)
- end
- def &(arg0)
- end
- def reverse_each
- end
- def flatten
- end
- def collect!
- end
- def size
- end
- def uniq!
- end
- def first(arg0, arg1, *rest)
- end
- def collect
- end
- def fill(arg0, arg1, *rest)
- end
- def reject!
- end
- def reverse
- end
- def *(arg0)
- end
- def insert(arg0, arg1, *rest)
- end
- def pack(arg0)
- end
- def unshift(arg0, arg1, *rest)
- end
- def compact
- end
- def transpose
- end
- def +(arg0)
- end
- def replace(arg0)
- end
- def at(arg0)
- end
- def select(arg0, arg1, *rest)
- end
- def zip(arg0, arg1, *rest)
- end
- def pop
- end
- def uniq
- end
- def to_s
- end
- def -(arg0)
- end
- def eql?(arg0)
- end
- def index(arg0)
- end
- def delete_if
- end
- def map!
- end
- def indexes(arg0, arg1, *rest)
- end
- def hash
- end
- def [](arg0, arg1, *rest)
- end
- def []=(arg0, arg1, *rest)
- end
- def last(arg0, arg1, *rest)
- end
- def |(arg0)
- end
- def map
- end
- def assoc(arg0)
- end
- def <<(arg0)
- end
- def values_at(arg0, arg1, *rest)
- end
- def each_index
- end
- def sort!
- end
- def length
- end
- def slice!(arg0, arg1, *rest)
- end
- def fetch(arg0, arg1, *rest)
- end
- def reject
- end
- def delete(arg0)
- end
- def clear
- end
- def sort
- end
- def each
- end
- def flatten!
- end
- def join(arg0, arg1, *rest)
- end
- def shift
- end
- def empty?
- end
- def inspect
- end
- def rindex(arg0)
- end
- def frozen?
- end
- def to_ary
- end
- def <=>(arg0)
- end
- def indices(arg0, arg1, *rest)
- end
- def ==(arg0)
- end
- def reverse!
- end
- def nitems
- end
- def slice(arg0, arg1, *rest)
- end
- def push(arg0, arg1, *rest)
- end
- def to_a
- end
- def rassoc(arg0)
- end
- def compact!
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/bignum.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/bignum.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/bignum.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,67 +0,0 @@
-class Bignum < Integer
- include Precision
- include Comparable
-
- def div
- end
- def **
- end
- def eql?
- end
- def size
- end
- def -
- end
- def <=>
- end
- def remainder
- end
- def []
- end
- def ==
- end
- def hash
- end
- def /
- end
- def quo
- end
- def |
- end
- def to_s
- end
- def coerce
- end
- def %
- end
- def <<
- end
- def rpower
- end
- def modulo
- end
- def &
- end
- def ~
- end
- def >>
- end
- def ^
- end
- def to_f
- end
- def power!
- end
- def rdiv
- end
- def divmod
- end
- def *
- end
- def -@
- end
- def +
- end
- def abs
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/binding.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/binding.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/binding.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,5 +0,0 @@
-class Binding < Object
-
- def clone
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/buffering.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/buffering.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/buffering.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,46 +0,0 @@
-module Buffering
- include Enumerable
-
- def getc
- end
- def ungetc(arg0)
- end
- def close
- end
- def sync=(arg0)
- end
- def gets(arg0, arg1, *rest)
- end
- def printf(arg0, arg1, *rest)
- end
- def read(arg0, arg1, *rest)
- end
- def readchar
- end
- def <<(arg0)
- end
- def puts(arg0, arg1, *rest)
- end
- def each(arg0, arg1, *rest)
- end
- def each_byte
- end
- def readlines(arg0, arg1, *rest)
- end
- def eof
- end
- def write(arg0)
- end
- def each_line(arg0, arg1, *rest)
- end
- def flush
- end
- def sync
- end
- def readline(arg0, arg1, *rest)
- end
- def eof?
- end
- def print(arg0, arg1, *rest)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/class.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/class.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/class.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,9 +0,0 @@
-class Class < Module
-
- def new(arg0, arg1, *rest)
- end
- def allocate
- end
- def superclass
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/comparable.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/comparable.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/comparable.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,15 +0,0 @@
-module Comparable
-
- def between?(arg0, arg1)
- end
- def ==(arg0)
- end
- def >=(arg0)
- end
- def <(arg0)
- end
- def <=(arg0)
- end
- def >(arg0)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/config.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/config.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/config.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,9 +0,0 @@
-module Config
-
- def self.gem_original_datadir(arg0)
- end
- def self.datadir(arg0)
- end
- def self.expand(arg0, arg1, arg2, *rest)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/continuation.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/continuation.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/continuation.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,7 +0,0 @@
-class Continuation < Object
-
- def []
- end
- def call
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/data.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/data.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/data.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class Data < Object
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/date.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/date.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/date.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,15 +0,0 @@
-class Date < Object
-
- def self.zone_to_diff(arg0)
- end
- def self._strptime(arg0, arg1, arg2, *rest)
- end
- def self._parse(arg0, arg1, arg2, *rest)
- end
- def asctime
- end
- def ctime
- end
- def strftime(arg0, arg1, *rest)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/datetime.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/datetime.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/datetime.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,7 +0,0 @@
-class DateTime < Date
-
- def self._strptime(arg0, arg1, arg2, *rest)
- end
- def strftime(arg0, arg1, *rest)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/digest.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/digest.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/digest.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-module Digest
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/dir.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/dir.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/dir.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,48 +0,0 @@
-class Dir < Object
- include Enumerable
-
- def self.mkdir(arg0, arg1, *rest)
- end
- def self.chdir(arg0, arg1, *rest)
- end
- def self.[](arg0)
- end
- def self.chroot(arg0)
- end
- def self.unlink(arg0)
- end
- def self.open(arg0)
- end
- def self.glob(arg0, arg1, *rest)
- end
- def self.pwd
- end
- def self.foreach(arg0)
- end
- def self.delete(arg0)
- end
- def self.rmdir(arg0)
- end
- def self.getwd
- end
- def self.entries(arg0)
- end
- def close
- end
- def rewind
- end
- def pos=
- end
- def seek
- end
- def read
- end
- def each
- end
- def tell
- end
- def path
- end
- def pos
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/enumerable.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/enumerable.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/enumerable.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,47 +0,0 @@
-module Enumerable
-
- def select(arg0, arg1, *rest)
- end
- def each_with_index
- end
- def grep(arg0)
- end
- def map
- end
- def find_all
- end
- def sort_by
- end
- def collect
- end
- def detect(arg0, arg1, *rest)
- end
- def max
- end
- def to_a
- end
- def sort
- end
- def partition
- end
- def any?
- end
- def include?(arg0)
- end
- def reject
- end
- def zip(arg0, arg1, *rest)
- end
- def find(arg0, arg1, *rest)
- end
- def min
- end
- def member?(arg0)
- end
- def entries
- end
- def inject(arg0, arg1, *rest)
- end
- def all?
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/eoferror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/eoferror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/eoferror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class EOFError < IOError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/errno.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/errno.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/errno.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-module Errno
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/exception.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/exception.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/exception.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,19 +0,0 @@
-class Exception < Object
-
- def self.exception(arg0, arg1, *rest)
- end
- def to_str
- end
- def backtrace
- end
- def inspect
- end
- def message
- end
- def to_s
- end
- def exception(arg0, arg1, *rest)
- end
- def set_backtrace(arg0)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/falseclass.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/falseclass.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/falseclass.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,11 +0,0 @@
-class FalseClass < Object
-
- def |
- end
- def to_s
- end
- def &
- end
- def ^
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/file.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/file.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/file.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,123 +0,0 @@
-class File < IO
- include File::Constants
- include Enumerable
-
- def self.writable?(arg0)
- end
- def self.size(arg0)
- end
- def self.blockdev?(arg0)
- end
- def self.mtime(arg0)
- end
- def self.rename(arg0, arg1)
- end
- def self.truncate(arg0, arg1)
- end
- def self.exist?(arg0)
- end
- def self.grpowned?(arg0)
- end
- def self.stat(arg0)
- end
- def self.link(arg0, arg1)
- end
- def self.executable_real?(arg0)
- end
- def self.setgid?(arg0)
- end
- def self.chmod(arg0, arg1, *rest)
- end
- def self.basename(arg0, arg1, *rest)
- end
- def self.fnmatch(arg0, arg1, *rest)
- end
- def self.readable_real?(arg0)
- end
- def self.socket?(arg0)
- end
- def self.atime(arg0)
- end
- def self.unlink(arg0, arg1, *rest)
- end
- def self.directory?(arg0)
- end
- def self.owned?(arg0)
- end
- def self.lchown(arg0, arg1, *rest)
- end
- def self.executable?(arg0)
- end
- def self.setuid?(arg0)
- end
- def self.utime(arg0, arg1, *rest)
- end
- def self.expand_path(arg0, arg1, *rest)
- end
- def self.fnmatch?(arg0, arg1, *rest)
- end
- def self.readable?(arg0)
- end
- def self.symlink?(arg0)
- end
- def self.ftype(arg0)
- end
- def self.readlink(arg0)
- end
- def self.size?(arg0)
- end
- def self.lchmod(arg0, arg1, *rest)
- end
- def self.delete(arg0, arg1, *rest)
- end
- def self.extname(arg0)
- end
- def self.writable_real?(arg0)
- end
- def self.chardev?(arg0)
- end
- def self.ctime(arg0)
- end
- def self.umask(arg0, arg1, *rest)
- end
- def self.split(arg0)
- end
- def self.join(arg0, arg1, *rest)
- end
- def self.exists?(arg0)
- end
- def self.pipe?(arg0)
- end
- def self.lstat(arg0)
- end
- def self.symlink(arg0, arg1)
- end
- def self.file?(arg0)
- end
- def self.zero?(arg0)
- end
- def self.sticky?(arg0)
- end
- def self.chown(arg0, arg1, *rest)
- end
- def self.dirname(arg0)
- end
- def mtime
- end
- def truncate
- end
- def chmod
- end
- def atime
- end
- def flock
- end
- def ctime
- end
- def path
- end
- def lstat
- end
- def chown
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/filetest.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/filetest.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/filetest.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,49 +0,0 @@
-module FileTest
-
- def self.writable?(arg0)
- end
- def self.size(arg0)
- end
- def self.blockdev?(arg0)
- end
- def self.exist?(arg0)
- end
- def self.grpowned?(arg0)
- end
- def self.executable_real?(arg0)
- end
- def self.setgid?(arg0)
- end
- def self.readable_real?(arg0)
- end
- def self.socket?(arg0)
- end
- def self.directory?(arg0)
- end
- def self.owned?(arg0)
- end
- def self.executable?(arg0)
- end
- def self.setuid?(arg0)
- end
- def self.readable?(arg0)
- end
- def self.symlink?(arg0)
- end
- def self.size?(arg0)
- end
- def self.writable_real?(arg0)
- end
- def self.chardev?(arg0)
- end
- def self.exists?(arg0)
- end
- def self.pipe?(arg0)
- end
- def self.file?(arg0)
- end
- def self.zero?(arg0)
- end
- def self.sticky?(arg0)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/fileutils.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/fileutils.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/fileutils.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,81 +0,0 @@
-module FileUtils
-
- def mkdir(arg0, arg1, arg2, *rest)
- end
- def remove_file(arg0, arg1, arg2, *rest)
- end
- def chdir(arg0, arg1, arg2, *rest)
- end
- def uptodate?(arg0, arg1, arg2, arg3, *rest)
- end
- def link(arg0, arg1, arg2, arg3, *rest)
- end
- def cp_r(arg0, arg1, arg2, arg3, *rest)
- end
- def rm_r(arg0, arg1, arg2, *rest)
- end
- def cp(arg0, arg1, arg2, arg3, *rest)
- end
- def identical?(arg0, arg1)
- end
- def chmod(arg0, arg1, arg2, arg3, *rest)
- end
- def mkdir_p(arg0, arg1, arg2, *rest)
- end
- def ln(arg0, arg1, arg2, arg3, *rest)
- end
- def copy(arg0, arg1, arg2, arg3, *rest)
- end
- def mv(arg0, arg1, arg2, arg3, *rest)
- end
- def rmtree(arg0, arg1, arg2, *rest)
- end
- def touch(arg0, arg1, arg2, *rest)
- end
- def makedirs(arg0, arg1, arg2, *rest)
- end
- def copy_file(arg0, arg1, arg2, arg3, *rest)
- end
- def safe_unlink(arg0, arg1, arg2, *rest)
- end
- def ln_sf(arg0, arg1, arg2, arg3, *rest)
- end
- def copy_entry(arg0, arg1, arg2, arg3, *rest)
- end
- def rm(arg0, arg1, arg2, *rest)
- end
- def pwd
- end
- def rm_rf(arg0, arg1, arg2, *rest)
- end
- def install(arg0, arg1, arg2, arg3, *rest)
- end
- def cd(arg0, arg1, arg2, *rest)
- end
- def mkpath(arg0, arg1, arg2, *rest)
- end
- def rm_f(arg0, arg1, arg2, *rest)
- end
- def rmdir(arg0, arg1, arg2, *rest)
- end
- def ln_s(arg0, arg1, arg2, arg3, *rest)
- end
- def move(arg0, arg1, arg2, arg3, *rest)
- end
- def compare_file(arg0, arg1)
- end
- def getwd
- end
- def symlink(arg0, arg1, arg2, arg3, *rest)
- end
- def copy_stream(arg0, arg1)
- end
- def remove_dir(arg0, arg1, arg2, *rest)
- end
- def cmp(arg0, arg1)
- end
- def remove(arg0, arg1, arg2, *rest)
- end
- def compare_stream(arg0, arg1)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/fixnum.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/fixnum.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/fixnum.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,75 +0,0 @@
-class Fixnum < Integer
- include Precision
- include Comparable
-
- def self.induced_from(arg0)
- end
- def div
- end
- def **
- end
- def size
- end
- def -
- end
- def <=>
- end
- def ==
- end
- def []
- end
- def /
- end
- def quo
- end
- def |
- end
- def to_s
- end
- def %
- end
- def <<
- end
- def rpower
- end
- def modulo
- end
- def >=
- end
- def <
- end
- def ~
- end
- def &
- end
- def >>
- end
- def <=
- end
- def ^
- end
- def to_f
- end
- def to_sym
- end
- def >
- end
- def rdiv
- end
- def power!
- end
- def divmod
- end
- def *
- end
- def id2name
- end
- def -@
- end
- def +
- end
- def abs
- end
- def zero?
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/float.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/float.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/float.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,69 +0,0 @@
-class Float < Numeric
- include Precision
- include Comparable
-
- def self.induced_from(arg0)
- end
- def **
- end
- def eql?
- end
- def truncate
- end
- def -
- end
- def <=>
- end
- def ==
- end
- def hash
- end
- def to_int
- end
- def /
- end
- def round
- end
- def to_s
- end
- def coerce
- end
- def %
- end
- def finite?
- end
- def modulo
- end
- def >=
- end
- def <
- end
- def <=
- end
- def to_f
- end
- def ceil
- end
- def >
- end
- def infinite?
- end
- def divmod
- end
- def *
- end
- def to_i
- end
- def floor
- end
- def -@
- end
- def +
- end
- def abs
- end
- def zero?
- end
- def nan?
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/floatdomainerror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/floatdomainerror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/floatdomainerror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class FloatDomainError < RangeError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/forwardable.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/forwardable.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/forwardable.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,15 +0,0 @@
-module Forwardable
-
- def self.debug
- end
- def self.debug=(arg0)
- end
- def def_delegators(arg0, arg1, arg2, *rest)
- end
- def def_instance_delegator(arg0, arg1, arg2, arg3, *rest)
- end
- def def_delegator(arg0, arg1, arg2, arg3, *rest)
- end
- def def_instance_delegators(arg0, arg1, arg2, *rest)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/gc.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/gc.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/gc.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,11 +0,0 @@
-module GC
-
- def self.disable
- end
- def self.start
- end
- def self.enable
- end
- def garbage_collect
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/gem.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/gem.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/gem.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,45 +0,0 @@
-module Gem
-
- def self.dir
- end
- def self.activate(arg0, arg1, arg2, arg3, *rest)
- end
- def self.latest_load_paths
- end
- def self.source_index
- end
- def self.use_paths(arg0, arg1, arg2, *rest)
- end
- def self.default_dir
- end
- def self.cache
- end
- def self.configuration
- end
- def self.ensure_ssl_available
- end
- def self.manage_gems
- end
- def self.user_home
- end
- def self.ruby
- end
- def self.all_load_paths
- end
- def self.datadir(arg0)
- end
- def self.clear_paths
- end
- def self.required_location(arg0, arg1, arg2, arg3, *rest)
- end
- def self.config_file
- end
- def self.configuration=(arg0)
- end
- def self.path
- end
- def self.ssl_available=(arg0)
- end
- def self.ssl_available?
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/hash.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/hash.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/hash.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,96 +0,0 @@
-class Hash < Object
- include Enumerable
-
- def self.[](arg0, arg1, *rest)
- end
- def default_proc
- end
- def size
- end
- def values_at(arg0, arg1, *rest)
- end
- def select(arg0, arg1, *rest)
- end
- def inspect
- end
- def indices(arg0, arg1, *rest)
- end
- def has_key?(arg0)
- end
- def ==(arg0)
- end
- def [](arg0)
- end
- def each_pair
- end
- def []=(arg0, arg1)
- end
- def store(arg0, arg1)
- end
- def length
- end
- def empty?
- end
- def replace(arg0)
- end
- def to_s
- end
- def default(arg0, arg1, *rest)
- end
- def indexes(arg0, arg1, *rest)
- end
- def update(arg0)
- end
- def each
- end
- def each_key
- end
- def shift
- end
- def delete_if
- end
- def to_hash
- end
- def value?(arg0)
- end
- def to_a
- end
- def default=(arg0)
- end
- def sort
- end
- def delete(arg0)
- end
- def clear
- end
- def invert
- end
- def merge!(arg0)
- end
- def include?(arg0)
- end
- def key?(arg0)
- end
- def each_value
- end
- def reject
- end
- def reject!
- end
- def rehash
- end
- def fetch(arg0, arg1, *rest)
- end
- def index(arg0)
- end
- def keys
- end
- def merge(arg0)
- end
- def member?(arg0)
- end
- def has_value?(arg0)
- end
- def values
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/indexerror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/indexerror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/indexerror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class IndexError < StandardError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/integer.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/integer.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/integer.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,49 +0,0 @@
-class Integer < Numeric
- include Precision
- include Comparable
-
- def self.induced_from(arg0)
- end
- def truncate
- end
- def gcd2
- end
- def upto
- end
- def integer?
- end
- def times
- end
- def succ
- end
- def to_int
- end
- def denominator
- end
- def lcm
- end
- def round
- end
- def to_bn
- end
- def downto
- end
- def ceil
- end
- def gcd
- end
- def next
- end
- def numerator
- end
- def to_r
- end
- def to_i
- end
- def floor
- end
- def chr
- end
- def gcdlcm
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/interrupt.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/interrupt.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/interrupt.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class Interrupt < SignalException
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/io.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/io.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/io.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,121 +0,0 @@
-class IO < Object
- include File::Constants
- include Enumerable
-
- def self.select(arg0, arg1, *rest)
- end
- def self.for_fd(arg0, arg1, *rest)
- end
- def self.new(arg0, arg1, *rest)
- end
- def self.read(arg0, arg1, *rest)
- end
- def self.pipe
- end
- def self.open(arg0, arg1, *rest)
- end
- def self.sysopen(arg0, arg1, *rest)
- end
- def self.readlines(arg0, arg1, *rest)
- end
- def self.foreach(arg0, arg1, *rest)
- end
- def self.popen(arg0, arg1, *rest)
- end
- def getc
- end
- def ungetc
- end
- def close
- end
- def fsync
- end
- def sync=
- end
- def gets
- end
- def rewind
- end
- def pos=
- end
- def sysseek
- end
- def inspect
- end
- def stat
- end
- def printf
- end
- def syswrite
- end
- def seek
- end
- def close_write
- end
- def tty?
- end
- def read
- end
- def readchar
- end
- def closed?
- end
- def pid
- end
- def puts
- end
- def to_io
- end
- def <<
- end
- def binmode
- end
- def reopen
- end
- def each
- end
- def each_byte
- end
- def tell
- end
- def close_read
- end
- def lineno
- end
- def readlines
- end
- def write
- end
- def eof
- end
- def fcntl
- end
- def putc
- end
- def fileno
- end
- def each_line
- end
- def flush
- end
- def to_i
- end
- def sync
- end
- def lineno=
- end
- def readline
- end
- def pos
- end
- def eof?
- end
- def ioctl
- end
- def print
- end
- def sysread
- end
- def isatty
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/ioerror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/ioerror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/ioerror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class IOError < StandardError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/kernel.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/kernel.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/kernel.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,219 +0,0 @@
-module Kernel
-
- def self.String(arg0)
- end
- def self.iterator?
- end
- def self.at_exit
- end
- def self.sub(arg0, arg1, *rest)
- end
- def self.callcc
- end
- def self.getc
- end
- def self.select(arg0, arg1, *rest)
- end
- def self.lambda
- end
- def self.fail(arg0, arg1, *rest)
- end
- def self.chop!
- end
- def self.scan(arg0)
- end
- def self.gets(arg0, arg1, *rest)
- end
- def self.sleep(arg0, arg1, *rest)
- end
- def self.load(arg0, arg1, *rest)
- end
- def self.global_variables
- end
- def self.chomp(arg0, arg1, *rest)
- end
- def self.printf(arg0, arg1, *rest)
- end
- def self.exit!(arg0, arg1, *rest)
- end
- def self.Float(arg0)
- end
- def self.abort(arg0, arg1, *rest)
- end
- def self.p(arg0, arg1, *rest)
- end
- def self.rand(arg0, arg1, *rest)
- end
- def self.fork
- end
- def self.proc
- end
- def self.raise(arg0, arg1, *rest)
- end
- def self.set_trace_func(arg0)
- end
- def self.gsub!(arg0, arg1, *rest)
- end
- def self.warn(arg0)
- end
- def self.puts(arg0, arg1, *rest)
- end
- def self.system(arg0, arg1, *rest)
- end
- def self.format(arg0, arg1, *rest)
- end
- def self.throw(arg0, arg1, *rest)
- end
- def self.chop
- end
- def self.open(arg0, arg1, *rest)
- end
- def self.Integer(arg0)
- end
- def self.exit(arg0, arg1, *rest)
- end
- def self.readlines(arg0, arg1, *rest)
- end
- def self.srand(arg0, arg1, *rest)
- end
- def self.autoload(arg0, arg1)
- end
- def self.binding
- end
- def self.untrace_var(arg0, arg1, *rest)
- end
- def self.sub!(arg0, arg1, *rest)
- end
- def self.putc(arg0)
- end
- def self.test(arg0, arg1, *rest)
- end
- def self.sprintf(arg0, arg1, *rest)
- end
- def self.Array(arg0)
- end
- def self.eval(arg0, arg1, *rest)
- end
- def self.block_given?
- end
- def self.catch(arg0)
- end
- def self.gsub(arg0, arg1, *rest)
- end
- def self.split(arg0, arg1, *rest)
- end
- def self.syscall(arg0, arg1, *rest)
- end
- def self.`(arg0)
- end
- def self.trap(arg0, arg1, *rest)
- end
- def self.method_missing(arg0, arg1, *rest)
- end
- def self.caller(arg0, arg1, *rest)
- end
- def self.chomp!(arg0, arg1, *rest)
- end
- def self.readline(arg0, arg1, *rest)
- end
- def self.require(arg0)
- end
- def self.autoload?(arg0)
- end
- def self.loop
- end
- def self.local_variables
- end
- def self.trace_var(arg0, arg1, *rest)
- end
- def self.print(arg0, arg1, *rest)
- end
- def self.exec(arg0, arg1, *rest)
- end
- def clone
- end
- def protected_methods(arg0, arg1, *rest)
- end
- def freeze
- end
- def instance_variable_set(arg0, arg1)
- end
- def is_a?(arg0)
- end
- def type
- end
- def methods(arg0, arg1, *rest)
- end
- def =~(arg0)
- end
- def send(arg0, arg1, *rest)
- end
- def instance_of?(arg0)
- end
- def __id__
- end
- def instance_variables
- end
- def to_s
- end
- def eql?(arg0)
- end
- def dup
- end
- def hash
- end
- def private_methods(arg0, arg1, *rest)
- end
- def require_gem(arg0, arg1, arg2, *rest)
- end
- def require(arg0)
- end
- def nil?
- end
- def tainted?
- end
- def class
- end
- def singleton_methods(arg0, arg1, *rest)
- end
- def display(arg0, arg1, *rest)
- end
- def extend(arg0, arg1, *rest)
- end
- def instance_eval(arg0, arg1, *rest)
- end
- def untaint
- end
- def __send__(arg0, arg1, *rest)
- end
- def method(arg0)
- end
- def instance_variable_get(arg0)
- end
- def object_id
- end
- def kind_of?(arg0)
- end
- def inspect
- end
- def taint
- end
- def frozen?
- end
- def gem(arg0, arg1, arg2, *rest)
- end
- def ==(arg0)
- end
- def public_methods(arg0, arg1, *rest)
- end
- def id
- end
- def respond_to?(arg0, arg1, *rest)
- end
- def ===(arg0)
- end
- def equal?(arg0)
- end
- def to_a
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/loaderror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/loaderror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/loaderror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class LoadError < ScriptError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/localjumperror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/localjumperror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/localjumperror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,7 +0,0 @@
-class LocalJumpError < StandardError
-
- def reason
- end
- def exit_value
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/marshal.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/marshal.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/marshal.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,9 +0,0 @@
-module Marshal
-
- def self.load(arg0, arg1, *rest)
- end
- def self.dump(arg0, arg1, *rest)
- end
- def self.restore(arg0, arg1, *rest)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/matchdata.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/matchdata.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/matchdata.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,33 +0,0 @@
-class MatchData < Object
-
- def size
- end
- def select
- end
- def values_at
- end
- def post_match
- end
- def begin
- end
- def inspect
- end
- def []
- end
- def length
- end
- def pre_match
- end
- def offset
- end
- def to_s
- end
- def captures
- end
- def to_a
- end
- def string
- end
- def end
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/math.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/math.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/math.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,47 +0,0 @@
-module Math
-
- def self.atan2(arg0, arg1)
- end
- def self.asinh(arg0)
- end
- def self.cosh(arg0)
- end
- def self.ldexp(arg0, arg1)
- end
- def self.tan(arg0)
- end
- def self.log(arg0)
- end
- def self.acosh(arg0)
- end
- def self.erfc(arg0)
- end
- def self.atan(arg0)
- end
- def self.frexp(arg0)
- end
- def self.sin(arg0)
- end
- def self.exp(arg0)
- end
- def self.tanh(arg0)
- end
- def self.erf(arg0)
- end
- def self.asin(arg0)
- end
- def self.sqrt(arg0)
- end
- def self.cos(arg0)
- end
- def self.atanh(arg0)
- end
- def self.sinh(arg0)
- end
- def self.hypot(arg0, arg1)
- end
- def self.acos(arg0)
- end
- def self.log10(arg0)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/method.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/method.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/method.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,21 +0,0 @@
-class Method < Object
-
- def arity
- end
- def inspect
- end
- def ==
- end
- def []
- end
- def call
- end
- def to_s
- end
- def unbind
- end
- def clone
- end
- def to_proc
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/module.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/module.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/module.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,75 +0,0 @@
-class Module < Object
-
- def self.constants
- end
- def self.nesting
- end
- def public_method_defined?(arg0)
- end
- def <=>(arg0)
- end
- def constants
- end
- def module_eval(arg0, arg1, *rest)
- end
- def freeze
- end
- def ==(arg0)
- end
- def instance_methods(arg0, arg1, *rest)
- end
- def ===(arg0)
- end
- def method_defined?(arg0)
- end
- def to_s
- end
- def included_modules
- end
- def private_instance_methods(arg0, arg1, *rest)
- end
- def private_class_method(arg0, arg1, *rest)
- end
- def instance_method(arg0)
- end
- def <(arg0)
- end
- def >=(arg0)
- end
- def class_variables
- end
- def protected_method_defined?(arg0)
- end
- def <=(arg0)
- end
- def ancestors
- end
- def const_set(arg0, arg1)
- end
- def autoload(arg0, arg1)
- end
- def >(arg0)
- end
- def include?(arg0)
- end
- def protected_instance_methods(arg0, arg1, *rest)
- end
- def public_class_method(arg0, arg1, *rest)
- end
- def const_missing(arg0)
- end
- def private_method_defined?(arg0)
- end
- def name
- end
- def const_get(arg0)
- end
- def const_defined?(arg0)
- end
- def class_eval(arg0, arg1, *rest)
- end
- def autoload?(arg0)
- end
- def public_instance_methods(arg0, arg1, *rest)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/nameerror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/nameerror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/nameerror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,7 +0,0 @@
-class NameError < StandardError
-
- def to_s
- end
- def name
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/nilclass.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/nilclass.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/nilclass.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,21 +0,0 @@
-class NilClass < Object
-
- def inspect
- end
- def |
- end
- def to_s
- end
- def &
- end
- def to_f
- end
- def ^
- end
- def nil?
- end
- def to_a
- end
- def to_i
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/nomemoryerror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/nomemoryerror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/nomemoryerror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class NoMemoryError < Exception
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/nomethoderror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/nomethoderror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/nomethoderror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,5 +0,0 @@
-class NoMethodError < NameError
-
- def args
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/notimplementederror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/notimplementederror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/notimplementederror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class NotImplementedError < ScriptError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/numeric.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/numeric.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/numeric.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,46 +0,0 @@
-class Numeric < Object
- include Comparable
-
- def eql?(arg0)
- end
- def div(arg0)
- end
- def truncate
- end
- def <=>(arg0)
- end
- def remainder(arg0)
- end
- def to_int
- end
- def integer?
- end
- def quo(arg0)
- end
- def round
- end
- def coerce(arg0)
- end
- def modulo(arg0)
- end
- def singleton_method_added(arg0)
- end
- def ceil
- end
- def nonzero?
- end
- def divmod(arg0)
- end
- def step(arg0, arg1, *rest)
- end
- def +@
- end
- def floor
- end
- def -@
- end
- def abs
- end
- def zero?
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/object.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/object.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/object.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,4 +0,0 @@
-class Object
- include Kernel
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/objectspace.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/objectspace.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/objectspace.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,21 +0,0 @@
-module ObjectSpace
-
- def self.undefine_finalizer(arg0)
- end
- def self.remove_finalizer(arg0)
- end
- def self.garbage_collect
- end
- def self.define_finalizer(arg0, arg1, *rest)
- end
- def self.add_finalizer(arg0)
- end
- def self.call_finalizer(arg0)
- end
- def self.each_object(arg0, arg1, *rest)
- end
- def self._id2ref(arg0)
- end
- def self.finalizers
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/openssl.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/openssl.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/openssl.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,7 +0,0 @@
-module OpenSSL
-
- def self.debug
- end
- def self.debug=(arg0)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/parsedate.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/parsedate.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/parsedate.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,5 +0,0 @@
-module ParseDate
-
- def self.parsedate(arg0, arg1, arg2, *rest)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/precision.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/precision.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/precision.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,11 +0,0 @@
-module Precision
-
- def self.included(arg0)
- end
- def prec_f
- end
- def prec_i
- end
- def prec(arg0)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/proc.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/proc.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/proc.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,23 +0,0 @@
-class Proc < Object
-
- def self.new(arg0, arg1, *rest)
- end
- def arity
- end
- def []
- end
- def ==
- end
- def dup
- end
- def call
- end
- def to_s
- end
- def clone
- end
- def binding
- end
- def to_proc
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/process.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/process.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/process.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,71 +0,0 @@
-module Process
-
- def self.waitpid(arg0, arg1, *rest)
- end
- def self.initgroups(arg0, arg1)
- end
- def self.groups=(arg0)
- end
- def self.getpriority(arg0, arg1)
- end
- def self.exit!(arg0, arg1, *rest)
- end
- def self.detach(arg0)
- end
- def self.setpgrp
- end
- def self.gid
- end
- def self.times
- end
- def self.fork
- end
- def self.abort(arg0, arg1, *rest)
- end
- def self.wait2(arg0, arg1, *rest)
- end
- def self.pid
- end
- def self.egid
- end
- def self.setsid
- end
- def self.waitall
- end
- def self.getpgrp
- end
- def self.uid
- end
- def self.gid=(arg0)
- end
- def self.maxgroups
- end
- def self.exit(arg0, arg1, *rest)
- end
- def self.wait(arg0, arg1, *rest)
- end
- def self.euid
- end
- def self.egid=(arg0)
- end
- def self.setpgid(arg0, arg1)
- end
- def self.kill(arg0, arg1, *rest)
- end
- def self.waitpid2(arg0, arg1, *rest)
- end
- def self.ppid
- end
- def self.uid=(arg0)
- end
- def self.groups
- end
- def self.maxgroups=(arg0)
- end
- def self.setpriority(arg0, arg1, arg2)
- end
- def self.euid=(arg0)
- end
- def self.getpgid(arg0)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/range.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/range.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/range.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,34 +0,0 @@
-class Range < Object
- include Enumerable
-
- def eql?
- end
- def begin
- end
- def inspect
- end
- def ==
- end
- def hash
- end
- def exclude_end?
- end
- def ===
- end
- def last
- end
- def to_s
- end
- def each
- end
- def first
- end
- def include?
- end
- def step
- end
- def end
- end
- def member?
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/rangeerror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/rangeerror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/rangeerror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class RangeError < StandardError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/rational.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/rational.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/rational.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,46 +0,0 @@
-class Rational < Numeric
- include Comparable
-
- def self.new!(arg0, arg1, arg2, *rest)
- end
- def self.reduce(arg0, arg1, arg2, *rest)
- end
- def **
- end
- def -
- end
- def <=>
- end
- def inspect
- end
- def ==
- end
- def hash
- end
- def denominator
- end
- def /
- end
- def %
- end
- def coerce
- end
- def to_s
- end
- def to_f
- end
- def to_r
- end
- def numerator
- end
- def divmod
- end
- def *
- end
- def to_i
- end
- def +
- end
- def abs
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/regexp.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/regexp.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/regexp.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,39 +0,0 @@
-class Regexp < Object
-
- def self.last_match(arg0, arg1, *rest)
- end
- def self.compile(arg0, arg1, *rest)
- end
- def self.union(arg0, arg1, *rest)
- end
- def self.escape(arg0, arg1, *rest)
- end
- def self.quote(arg0, arg1, *rest)
- end
- def eql?
- end
- def kcode
- end
- def inspect
- end
- def casefold?
- end
- def hash
- end
- def ==
- end
- def ===
- end
- def options
- end
- def to_s
- end
- def ~
- end
- def match
- end
- def =~
- end
- def source
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/regexperror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/regexperror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/regexperror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class RegexpError < StandardError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/runtimeerror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/runtimeerror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/runtimeerror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class RuntimeError < StandardError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/scripterror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/scripterror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/scripterror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class ScriptError < Exception
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/securityerror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/securityerror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/securityerror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class SecurityError < StandardError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/signal.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/signal.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/signal.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,7 +0,0 @@
-module Signal
-
- def self.list
- end
- def self.trap(arg0, arg1, *rest)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/signalexception.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/signalexception.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/signalexception.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class SignalException < Exception
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/singleforwardable.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/singleforwardable.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/singleforwardable.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,11 +0,0 @@
-module SingleForwardable
-
- def def_singleton_delegator(arg0, arg1, arg2, arg3, *rest)
- end
- def def_delegators(arg0, arg1, arg2, *rest)
- end
- def def_singleton_delegators(arg0, arg1, arg2, *rest)
- end
- def def_delegator(arg0, arg1, arg2, arg3, *rest)
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/standarderror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/standarderror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/standarderror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class StandardError < Exception
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/string.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/string.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/string.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,171 +0,0 @@
-class String < Object
- include Enumerable
- include Comparable
-
- def concat(arg0)
- end
- def include?(arg0)
- end
- def upto(arg0)
- end
- def lstrip
- end
- def each_byte
- end
- def succ!
- end
- def chop!
- end
- def size
- end
- def delete!(arg0, arg1, *rest)
- end
- def dump
- end
- def rjust(arg0, arg1, *rest)
- end
- def squeeze(arg0, arg1, *rest)
- end
- def next
- end
- def reverse
- end
- def *(arg0)
- end
- def sub!(arg0, arg1, *rest)
- end
- def insert(arg0, arg1)
- end
- def chomp(arg0, arg1, *rest)
- end
- def tr_s(arg0, arg1)
- end
- def +(arg0)
- end
- def =~(arg0)
- end
- def tr!(arg0, arg1)
- end
- def replace(arg0)
- end
- def scan(arg0)
- end
- def lstrip!
- end
- def succ
- end
- def oct
- end
- def capitalize
- end
- def gsub(arg0, arg1, *rest)
- end
- def to_s
- end
- def capitalize!
- end
- def eql?(arg0)
- end
- def index(arg0, arg1, *rest)
- end
- def crypt(arg0)
- end
- def to_i(arg0, arg1, *rest)
- end
- def chomp!(arg0, arg1, *rest)
- end
- def rstrip
- end
- def sum(arg0, arg1, *rest)
- end
- def hash
- end
- def [](arg0, arg1, *rest)
- end
- def upcase!
- end
- def squeeze!(arg0, arg1, *rest)
- end
- def upcase
- end
- def []=(arg0, arg1, *rest)
- end
- def center(arg0, arg1, *rest)
- end
- def count(arg0, arg1, *rest)
- end
- def <<(arg0)
- end
- def strip
- end
- def each_line(arg0, arg1, *rest)
- end
- def gsub!(arg0, arg1, *rest)
- end
- def length
- end
- def unpack(arg0)
- end
- def slice!(arg0, arg1, *rest)
- end
- def ljust(arg0, arg1, *rest)
- end
- def delete(arg0, arg1, *rest)
- end
- def tr_s!(arg0, arg1)
- end
- def to_str
- end
- def split(arg0, arg1, *rest)
- end
- def each(arg0, arg1, *rest)
- end
- def rstrip!
- end
- def swapcase!
- end
- def casecmp(arg0)
- end
- def swapcase
- end
- def chop
- end
- def empty?
- end
- def inspect
- end
- def <=>(arg0)
- end
- def intern
- end
- def rindex(arg0, arg1, *rest)
- end
- def to_sym
- end
- def tr(arg0, arg1)
- end
- def ==(arg0)
- end
- def hex
- end
- def match(arg0)
- end
- def to_f
- end
- def reverse!
- end
- def next!
- end
- def strip!
- end
- def slice(arg0, arg1, *rest)
- end
- def sub(arg0, arg1, *rest)
- end
- def downcase
- end
- def %(arg0)
- end
- def downcase!
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/struct.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/struct.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/struct.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,38 +0,0 @@
-class Struct < Object
- include Enumerable
-
- def self.new(arg0, arg1, *rest)
- end
- def eql?
- end
- def size
- end
- def select
- end
- def values_at
- end
- def inspect
- end
- def ==
- end
- def hash
- end
- def each_pair
- end
- def []
- end
- def members
- end
- def length
- end
- def []=
- end
- def to_s
- end
- def each
- end
- def to_a
- end
- def values
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/symbol.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/symbol.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/symbol.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,19 +0,0 @@
-class Symbol < Object
-
- def self.all_symbols
- end
- def inspect
- end
- def to_int
- end
- def ===
- end
- def to_s
- end
- def to_sym
- end
- def to_i
- end
- def id2name
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/syntaxerror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/syntaxerror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/syntaxerror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,3 +0,0 @@
-class SyntaxError < ScriptError
-
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/systemcallerror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/systemcallerror.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/systemcallerror.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,7 +0,0 @@
-class SystemCallError < StandardError
-
- def self.===(arg0)
- end
- def errno
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/systemexit.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/systemexit.rb 2007-01-29 14:50:30 UTC (rev 1892)
+++ trunk/org.rubypeople.rdt.core/ruby/lib/systemexit.rb 2007-01-29 14:55:03 UTC (rev 1893)
@@ -1,7 +0,0 @@
-class SystemExit < Exception
-
- def status
- end
- def success?
- end
-end
Deleted: trunk/org.rubypeople.rdt.core/ruby/lib/systemstackerror.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/lib/systemstackerror.rb 2007-01-29 14:50:30...
[truncated message content] |
|
From: <caw...@us...> - 2007-01-29 14:50:34
|
Revision: 1892
http://svn.sourceforge.net/rubyeclipse/?rev=1892&view=rev
Author: cawilliams
Date: 2007-01-29 06:50:30 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
handle an empty copmpletion prefix (suggest type names, constants and elements in the current document). Also add some task markers to remind that we should probably do some cleanup of the compeltion proposals - they shouldn't have duplicates, and they should be sorted by relevance and name.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java
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-01-29 14:49:11 UTC (rev 1891)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-01-29 14:50:30 UTC (rev 1892)
@@ -90,9 +90,14 @@
if (this.prefix != null)
replaceStart -= this.prefix.length();
- if (isConstant()) { // type or constant
+ // TODO Refactor out common code here...
+ if (this.prefix != null && this.prefix.length() == 0) { // empty prefix
suggestTypeNames(replaceStart);
suggestConstantNames(replaceStart);
+ getDocumentsRubyElementsInScope(script, source.toString(), offset, replaceStart);
+ } else if (isConstant()) { // type or constant
+ suggestTypeNames(replaceStart);
+ suggestConstantNames(replaceStart);
} else { // method or variable
ITypeInferrer inferrer = new DefaultTypeInferrer();
List<ITypeGuess> guesses = inferrer.infer(source.toString(), offset);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java 2007-01-29 14:49:11 UTC (rev 1891)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java 2007-01-29 14:50:30 UTC (rev 1892)
@@ -24,6 +24,7 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorPart;
import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.corext.template.ruby.RubyContextType;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
@@ -110,20 +111,12 @@
cursorPosition = selection.getOffset() + selection.getLength();
List templates = determineTemplateProposals(viewer, documentOffset);
- ICompletionProposal[] templateArray = new ICompletionProposal[templates
- .size()];
- int i = 0;
- for (Iterator iter = templates.iterator(); iter.hasNext(); i++) {
- templateArray[i] = (ICompletionProposal) iter.next();
- }
- ICompletionProposal[] merged = templateArray;
-
- ICompletionProposal[] keywords = determineKeywordProposals(viewer,
- documentOffset);
- ICompletionProposal[] mergedTwo = merge(merged, keywords);
-
- ICompletionProposal[] completions = codeComplete(documentOffset);
- return merge(mergedTwo, completions);
+ ICompletionProposal[] templateArray = (ICompletionProposal[]) templates.toArray(new ICompletionProposal[templates
+ .size()]);
+ ICompletionProposal[] keyWordsAndTemplates = merge(templateArray, determineKeywordProposals(viewer,
+ documentOffset));
+// FIXME Sort and remove duplicates?
+ return merge(keyWordsAndTemplates, codeComplete(documentOffset));
}
private ICompletionProposal[] codeComplete(int offset) {
@@ -135,7 +128,7 @@
requestor.endReporting();
return requestor.getRubyCompletionProposals();
} catch (RubyModelException e) {
- // TODO Do something
+ RubyPlugin.log(e);
return new ICompletionProposal[0];
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-29 14:49:12
|
Revision: 1891
http://svn.sourceforge.net/rubyeclipse/?rev=1891&view=rev
Author: cawilliams
Date: 2007-01-29 06:49:11 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
move the core_stuibber ruby script over to launching. Invoke it under the hood of StandardVM so we can generate core stubs and add them to our default load path (really only so we can treat them like the rest of the libraries and get them into the model).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstall.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/ruby/core_stubber.rb
Removed Paths:
-------------
trunk/org.rubypeople.rdt.core/ruby/core_stubber.rb
Deleted: trunk/org.rubypeople.rdt.core/ruby/core_stubber.rb
===================================================================
--- trunk/org.rubypeople.rdt.core/ruby/core_stubber.rb 2007-01-29 09:09:18 UTC (rev 1890)
+++ trunk/org.rubypeople.rdt.core/ruby/core_stubber.rb 2007-01-29 14:49:11 UTC (rev 1891)
@@ -1,81 +0,0 @@
-OUTPUT_PATH = "ruby/lib/"
-
-def file_name(klass)
- file_name = OUTPUT_PATH + klass.to_s.downcase
- file_name.gsub!("::", "/")
- file_name << ".rb"
- return file_name
-end
-
-def dir_names(file_name)
- last_slash = file_name.rindex("/")
- return nil if last_slash.nil?
- file_name[0...last_slash]
-end
-
-def print_method(f, method, method_name, singleton = false)
- f << " def "
- f << "self." if singleton
- f << method_name.to_s
- if !method.nil? and method.arity != 0
- # TODO We need to handle methods that take blocks!
- f << "("
- if method.arity < 0
- args = []
- (method.arity.abs + 1).times {|i| args << "arg#{i}" }
- args << "*rest"
- f << args.join(", ")
- else
- args = []
- method.arity.times {|i| args << "arg#{i}" }
- f << args.join(", ")
- end
- f << ")"
- end
- f << "\n end\n"
-end
-
-require 'FileUtils'
-@klasses = Module.constants.select {|c| ["Class", "Module"].include?(eval("#{c}.class").to_s) }
-@klasses = @klasses.collect {|k| eval("#{k}")}
-@klasses = @klasses.uniq.sort_by {|klass| klass.to_s }
-@klasses.each do |klass|
- next if klass.to_s[0].chr == "f" # TODO Skip if first char is lowercase
- file_name = file_name(klass)
- dirs = dir_names(file_name)
- FileUtils.mkdir_p(dirs) if !dirs.nil? and !File.exist?(file_name)
- open(file_name, 'w') do |f|
- f << "#{klass.class.to_s.downcase} #{klass}"
- f << " < #{klass.superclass.to_s }" if klass.respond_to?(:superclass) and !klass.superclass.nil?
- f << "\n"
- klass.included_modules.each {|mod| f << " include #{mod.to_s}\n" unless mod.to_s == "Kernel" && klass.to_s != "Object"}
- f << "\n"
- klass.methods(false).each do |method_name|
- method = eval("#{klass}").method(method_name) rescue nil
- print_method(f, method, method_name.to_s, true)
- end
- # TODO Fix it so we can get a hold of the module instance methods properly
- klass.instance_methods(false).each do |method_name|
- begin
- obj = if klass.class.to_s == "Module" then klass else klass.new end
- method = obj.method(method_name.to_s)
- rescue StandardError => e
- puts e
- # TODO If we can't create an instance of a class, generate dynamic subclass where we can, and then
- # grab methods from there
- begin
- # If we're a module, we may need to force the function to be more visible to grab it
- obj.module_eval do
- module_function(method_name.to_s)
- end
- method = obj.method(method_name.to_s)
- rescue StandardError => e
- puts e
- method = nil
- end
- end
- print_method(f, method, method_name.to_s)
- end
- f << "end\n"
- end
-end
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.launching/ruby/core_stubber.rb
===================================================================
--- trunk/org.rubypeople.rdt.launching/ruby/core_stubber.rb (rev 0)
+++ trunk/org.rubypeople.rdt.launching/ruby/core_stubber.rb 2007-01-29 14:49:11 UTC (rev 1891)
@@ -0,0 +1,81 @@
+OUTPUT_PATH = ARGV.first + "/"
+
+def file_name(klass)
+ file_name = OUTPUT_PATH + klass.to_s.downcase
+ file_name.gsub!("::", "/")
+ file_name << ".rb"
+ return file_name
+end
+
+def dir_names(file_name)
+ last_slash = file_name.rindex("/")
+ return nil if last_slash.nil?
+ file_name[0...last_slash]
+end
+
+def print_method(f, method, method_name, singleton = false)
+ f << " def "
+ f << "self." if singleton
+ f << method_name.to_s
+ if !method.nil? and method.arity != 0
+ # TODO We need to handle methods that take blocks!
+ f << "("
+ if method.arity < 0
+ args = []
+ (method.arity.abs + 1).times {|i| args << "arg#{i}" }
+ args << "*rest"
+ f << args.join(", ")
+ else
+ args = []
+ method.arity.times {|i| args << "arg#{i}" }
+ f << args.join(", ")
+ end
+ f << ")"
+ end
+ f << "\n end\n"
+end
+
+require 'FileUtils'
+@klasses = Module.constants.select {|c| ["Class", "Module"].include?(eval("#{c}.class").to_s) }
+@klasses = @klasses.collect {|k| eval("#{k}")}
+@klasses = @klasses.uniq.sort_by {|klass| klass.to_s }
+@klasses.each do |klass|
+ next if klass.to_s[0].chr == "f" # TODO Skip if first char is lowercase
+ file_name = file_name(klass)
+ dirs = dir_names(file_name)
+ FileUtils.mkdir_p(dirs) if !dirs.nil? and !File.exist?(file_name)
+ open(file_name, 'w') do |f|
+ f << "#{klass.class.to_s.downcase} #{klass}"
+ f << " < #{klass.superclass.to_s }" if klass.respond_to?(:superclass) and !klass.superclass.nil?
+ f << "\n"
+ klass.included_modules.each {|mod| f << " include #{mod.to_s}\n" unless mod.to_s == "Kernel" && klass.to_s != "Object"}
+ f << "\n"
+ klass.methods(false).each do |method_name|
+ method = eval("#{klass}").method(method_name) rescue nil
+ print_method(f, method, method_name.to_s, true)
+ end
+ # TODO Fix it so we can get a hold of the module instance methods properly
+ klass.instance_methods(false).each do |method_name|
+ begin
+ obj = if klass.class.to_s == "Module" then klass else klass.new end
+ method = obj.method(method_name.to_s)
+ rescue StandardError => e
+ puts e
+ # TODO If we can't create an instance of a class, generate dynamic subclass where we can, and then
+ # grab methods from there
+ begin
+ # If we're a module, we may need to force the function to be more visible to grab it
+ obj.module_eval do
+ module_function(method_name.to_s)
+ end
+ method = obj.method(method_name.to_s)
+ rescue StandardError => e
+ puts e
+ method = nil
+ end
+ end
+ print_method(f, method, method_name.to_s)
+ end
+ f << "end\n"
+ end
+end
\ No newline at end of file
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-01-29 09:09:18 UTC (rev 1890)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java 2007-01-29 14:49:11 UTC (rev 1891)
@@ -1,14 +1,25 @@
package org.rubypeople.rdt.internal.launching;
import java.io.File;
+import java.io.IOException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+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.rubypeople.rdt.launching.AbstractVMInstall;
+import org.rubypeople.rdt.launching.IVMInstallChangedListener;
import org.rubypeople.rdt.launching.IVMInstallType;
import org.rubypeople.rdt.launching.IVMRunner;
+import org.rubypeople.rdt.launching.PropertyChangeEvent;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class StandardVM extends AbstractVMInstall {
+ private String fgSeparator;
+
public StandardVM(IVMInstallType type, String id) {
super(type, id);
}
@@ -55,4 +66,90 @@
return null;
}
+ @Override
+ public void setLibraryLocations(IPath[] locations) {
+ if (locations == fSystemLibraryDescriptions) {
+ return;
+ }
+ IPath[] newLocations = locations;
+ if (newLocations == null) {
+ newLocations = getDefaultLibraryLocations();
+ }
+ IPath[] prevLocations = fSystemLibraryDescriptions;
+ if (prevLocations == null) {
+ prevLocations = getDefaultLibraryLocations();
+ }
+
+ if (newLocations.length == prevLocations.length) {
+ int i = 0;
+ boolean equal = true;
+ while (i < newLocations.length && equal) {
+ equal = newLocations[i].equals(prevLocations[i]);
+ i++;
+ }
+ if (equal) {
+ // no change
+ return;
+ }
+ }
+
+ PropertyChangeEvent event = new PropertyChangeEvent(this, IVMInstallChangedListener.PROPERTY_LIBRARY_LOCATIONS, prevLocations, newLocations);
+ fSystemLibraryDescriptions = locations;
+ if (fNotify) {
+ RubyRuntime.fireVMChanged(event);
+ }
+ }
+
+ private IPath[] getDefaultLibraryLocations() {
+ IPath[] dflts = getVMInstallType().getDefaultLibraryLocations(getInstallLocation());
+ IPath[] paths = new IPath[dflts.length + 1];
+ for (int i = 0; i < dflts.length; i++) {
+ paths[i] = dflts[i];
+ }
+ // FIXME Handle possible null pointer being returned by findRubyExecutable
+ paths[dflts.length] = generateCoreStubs(StandardVMType.findRubyExecutable(getInstallLocation()));
+ return dflts;
+ }
+
+ /**
+ * Launch a ruby script to generate core class stubs for use in RDT internally (since Ruby core
+ * stuff is not in any scripts, they're built into the VM in C code).
+ * @param rubyExecutable
+ * @return an IPath pointing to the directory containing the core library stubs
+ */
+ private IPath generateCoreStubs(File rubyExecutable) {
+ //locate the script to generate our core stubs
+ File file = LaunchingPlugin.getFileInPlugin(new Path("ruby" + fgSeparator + "core_stubber.rb")); //$NON-NLS-1$
+ IPath path = new Path(file.getParentFile().getAbsolutePath() + fgSeparator + getId() + fgSeparator + "lib"); //$NON-NLS-1$
+ if (path.toFile().exists()) {
+ return path; // we've already created the stubs for this VM
+ }
+ path.toFile().mkdirs(); // Make the directory structure to throw the files into
+ if (file.exists()) {
+ String rubyExecutablePath = rubyExecutable.getAbsolutePath();
+ String[] cmdLine = new String[] {rubyExecutablePath, file.getAbsolutePath(), path.toOSString()};
+ Process p = null;
+ try {
+ p = Runtime.getRuntime().exec(cmdLine);
+ IProcess process = DebugPlugin.newProcess(new Launch(null, ILaunchManager.RUN_MODE, null), p, "Core Classes Stub Generation"); //$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) {
+ }
+ }
+ } catch (IOException ioe) {
+ LaunchingPlugin.log(ioe);
+ } finally {
+ if (p != null) {
+ p.destroy();
+ }
+ }
+ }
+ return path;
+ }
}
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-01-29 09:09:18 UTC (rev 1890)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-01-29 14:49:11 UTC (rev 1891)
@@ -28,7 +28,7 @@
* Map of the install path for which we were unable to generate
* the library info during this session.
*/
- private static Map fgFailedInstallPath= new HashMap();
+ private static Map<String, LibraryInfo> fgFailedInstallPath= new HashMap<String, LibraryInfo>();
/**
* Convenience handle to the system-specific file separator character
@@ -56,11 +56,6 @@
for (int i = 0; i < loadpath.length; i++) {
paths[i] = new Path(loadpath[i]);
}
-// String stdPath = installLocation.getAbsolutePath() + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "1.8";
-// String sitePath = installLocation.getAbsolutePath() + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "site_ruby" + fgSeparator + "1.8";
-// IPath[] paths = new IPath[2];
-// paths[0] = new Path(stdPath);
-// paths[1] = new Path(sitePath);
return paths;
}
@@ -90,12 +85,12 @@
*/
public static File findRubyExecutable(File vmInstallLocation) {
// Try each candidate in order. The first one found wins. Thus, the order
- // of fgCandidateJavaLocations and fgCandidateJavaFiles is significant.
+ // of fgCandidateRubyLocations and fgCandidateRubyFiles is significant.
for (int i = 0; i < fgCandidateRubyFiles.length; i++) {
for (int j = 0; j < fgCandidateRubyLocations.length; j++) {
- File javaFile = new File(vmInstallLocation, fgCandidateRubyLocations[j] + fgCandidateRubyFiles[i]);
- if (javaFile.isFile()) {
- return javaFile;
+ File rubyFile = new File(vmInstallLocation, fgCandidateRubyLocations[j] + fgCandidateRubyFiles[i]);
+ if (rubyFile.isFile()) {
+ return rubyFile;
}
}
}
@@ -133,7 +128,6 @@
info = getDefaultLibraryInfo(rubyHome);
fgFailedInstallPath.put(installPath, info);
} else {
- // only persist if we were able to generate info - see bug 70011
LaunchingPlugin.setLibraryInfo(installPath, info);
}
}
@@ -144,10 +138,10 @@
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/loadpath.rb")); //$NON-NLS-1$
+ File file = LaunchingPlugin.getFileInPlugin(new Path("ruby" + fgSeparator + "loadpath.rb")); //$NON-NLS-1$
if (file.exists()) {
- String javaExecutablePath = rubyExecutable.getAbsolutePath();
- String[] cmdLine = new String[] {javaExecutablePath, file.getAbsolutePath()}; //$NON-NLS-1$
+ String rubyExecutablePath = rubyExecutable.getAbsolutePath();
+ String[] cmdLine = new String[] {rubyExecutablePath, file.getAbsolutePath()}; //$NON-NLS-1$
Process p = null;
try {
p = Runtime.getRuntime().exec(cmdLine);
@@ -195,8 +189,7 @@
lines.add(line);
}
} catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ LaunchingPlugin.log(e);
}
if (lines.size() > 0) {
String version = lines.remove(0);
@@ -215,16 +208,25 @@
* @return LibraryInfo
*/
protected LibraryInfo getDefaultLibraryInfo(File installLocation) {
- IPath rtjar = getDefaultSystemLibrary(installLocation);
- return new LibraryInfo("1.8.4", new String[] {rtjar.toOSString()}); //$NON-NLS-1$
+ 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) {
- return new Path(rubyHome.getPath()).append("lib").append("ruby").append("1.8"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$
+ 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;
}
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstall.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstall.java 2007-01-29 09:09:18 UTC (rev 1890)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstall.java 2007-01-29 14:49:11 UTC (rev 1891)
@@ -31,13 +31,13 @@
private String fId;
private String fName;
private File fInstallLocation;
- private IPath[] fSystemLibraryDescriptions;
+ protected IPath[] fSystemLibraryDescriptions;
private String fVMArgs;
// system properties are cached in user preferences prefixed with this key, followed
// by vm type, vm id, and system property name
private static final String PREF_VM_INSTALL_SYSTEM_PROPERTY = "PREF_VM_INSTALL_SYSTEM_PROPERTY"; //$NON-NLS-1$
// whether change events should be fired
- private boolean fNotify = true;
+ protected boolean fNotify = true;
/**
* Constructs a new VM install.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-01-29 09:09:20
|
Revision: 1890
http://svn.sourceforge.net/rubyeclipse/?rev=1890&view=rev
Author: mirkostocker
Date: 2007-01-29 01:09:18 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
more patches for jruby, preparing for the refactorings import
Modified Paths:
--------------
trunk/org.jruby/lib/jruby.jar
trunk/org.jruby/src.zip
Added Paths:
-----------
trunk/org.jruby/patches/iterator_visitor.patch
trunk/org.jruby/patches/iternode_position.patch
trunk/org.jruby/patches/method_args.patch
trunk/org.jruby/patches/visit_rootnode.patch
Modified: trunk/org.jruby/lib/jruby.jar
===================================================================
(Binary files differ)
Added: trunk/org.jruby/patches/iterator_visitor.patch
===================================================================
--- trunk/org.jruby/patches/iterator_visitor.patch (rev 0)
+++ trunk/org.jruby/patches/iterator_visitor.patch 2007-01-29 09:09:18 UTC (rev 1890)
@@ -0,0 +1,69 @@
+Index: src/org/jruby/ast/visitor/DefaultIteratorVisitor.java
+===================================================================
+--- src/org/jruby/ast/visitor/DefaultIteratorVisitor.java (revision 1146)
++++ src/org/jruby/ast/visitor/DefaultIteratorVisitor.java (working copy)
+@@ -195,14 +195,14 @@
+ return null;
+ }
+
+- /** @fixme iteration not correctly defined */
+ public Instruction visitAttrAssignNode(AttrAssignNode iVisited) {
+ iVisited.accept(_Payload);
+- // FIXME
+- /*
+- * for (Node node = iVisited.getArgsNode(); node != null; node =
+- * node.getNextNode()) { node.getHeadNode().accept(this); }
+- */
++ if(iVisited.getArgsNode() != null) {
++ iVisited.getArgsNode().accept(this);
++ }
++ if(iVisited.getReceiverNode() != null) {
++ iVisited.getReceiverNode().accept(this);
++ }
+ return null;
+ }
+
+@@ -272,16 +272,14 @@
+ return null;
+ }
+
+- /**
+- * @fixme iteration not correctly defined
+- */
+ public Instruction visitCallNode(CallNode iVisited) {
+ iVisited.getReceiverNode().accept(this);
+- // FIXME
+- /*
+- * for (Node node = iVisited.getArgsNode(); node != null; node =
+- * node.getNextNode()) { node.getHeadNode().accept(this); }
+- */
++ if(iVisited.getArgsNode() != null) {
++ iVisited.getArgsNode().accept(this);
++ }
++ if(iVisited.getIterNode() != null) {
++ iVisited.getIterNode().accept(this);
++ }
+ iVisited.accept(_Payload);
+ return null;
+ }
+@@ -387,14 +385,14 @@
+ return null;
+ }
+
+- /** @fixme iteration not correctly defined */
+ public Instruction visitFCallNode(FCallNode iVisited) {
+ iVisited.accept(_Payload);
+- // FIXME
+- /*
+- * for (Node node = iVisited.getArgsNode(); node != null; node =
+- * node.getNextNode()) { node.getHeadNode().accept(this); }
+- */
++ if(iVisited.getArgsNode() != null) {
++ iVisited.getArgsNode().accept(this);
++ }
++ if(iVisited.getIterNode() != null) {
++ iVisited.getIterNode().accept(this);
++ }
+ return null;
+ }
+
Added: trunk/org.jruby/patches/iternode_position.patch
===================================================================
--- trunk/org.jruby/patches/iternode_position.patch (rev 0)
+++ trunk/org.jruby/patches/iternode_position.patch 2007-01-29 09:09:18 UTC (rev 1890)
@@ -0,0 +1,127 @@
+Index: test/testPositions.rb
+===================================================================
+--- test/testPositions.rb (revision 1128)
++++ test/testPositions.rb (working copy)
+@@ -341,7 +341,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,1,0,6],
+- ['IterNode',0,0,4,6],
++ ['IterNode',0,0,0,6],
+ ['FCallNode',0,0,0,6]
+ ]
+ test_tree(list, <<'END', "operation brace_block [paren-less no-args block")
+@@ -351,7 +351,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,1,0,6],
+- ['IterNode',0,1,4,10],
++ ['IterNode',0,1,0,10],
+ ['FCallNode',0,1,0,10]
+ ]
+
+@@ -363,7 +363,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,1,6,9],
+- ['IterNode',0,0,6,8],
++ ['IterNode',0,0,0,8],
+ ['FCallNode',0,0,0,8],
+ ['ArrayNode',0,0,3,5]
+ ]
+@@ -375,7 +375,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,1,6,9],
+- ['IterNode',0,1,6,12],
++ ['IterNode',0,1,0,12],
+ ['FCallNode',0,1,0,12],
+ ['ArrayNode',0,0,3,5]
+ ]
+@@ -388,7 +388,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,2,6,17],
+- ['IterNode',0,1,6,16],
++ ['IterNode',0,1,0,16],
+ ['DAsgnNode',0,0,10,11],
+ ['FCallNode',0,1,0,16],
+ ['ArrayNode',0,0,3,5]
+@@ -402,7 +402,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,2,6,19],
+- ['IterNode',0,1,6,18],
++ ['IterNode',0,1,0,18],
+ ['MultipleAsgnNode',0,0,9,14],
+ ['ArrayNode',0,0,10,13],
+ ['DAsgnNode',0,0,10,11],
+@@ -419,7 +419,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,2,10,23],
+- ['IterNode',0,1,10,22],
++ ['IterNode',0,1,0,22],
+ ['MultipleAsgnNode',0,0,13,18],
+ ['ArrayNode',0,0,14,17],
+ ['DAsgnNode',0,0,14,15],
+@@ -1282,7 +1282,7 @@
+ list = [
+ nil,
+ nil,
+-['IterNode', 0, 2, 15, 34],
++['IterNode', 0, 2, 0, 34],
+ ['DAsgnNode', 0, 0, 19, 20],
+ nil,
+ ['FCallNode', 1, 1, 24, 30],
+@@ -1460,7 +1460,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode', 0, 1, 0, 25],
+-['IterNode', 0, 0, 8, 24],
++['IterNode', 0, 0, 0, 24],
+ nil, #['NewlineNode', 0, 0, 10, 24],
+ ['FCallNode', 0, 0, 10, 22],
+ ['ArrayNode', 0, 0, 15, 22],
+Index: src/org/jruby/parser/DefaultRubyParser.java
+===================================================================
+--- src/org/jruby/parser/DefaultRubyParser.java (revision 1128)
++++ src/org/jruby/parser/DefaultRubyParser.java (working copy)
+@@ -2583,7 +2583,7 @@
+ case 351:
+ // line 1269 "DefaultRubyParser.y"
+ {
+- yyVal = new IterNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), null);
++ yyVal = new IterNode(support.union(((ISourcePositionHolder)yyVals[-5+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), null);
+ support.popCurrentScope();
+ }
+ break;
+@@ -2596,7 +2596,7 @@
+ case 353:
+ // line 1275 "DefaultRubyParser.y"
+ {
+- yyVal = new IterNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), null);
++ yyVal = new IterNode(support.union(((ISourcePositionHolder)yyVals[-5+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), null);
+ support.popCurrentScope();
+ }
+ break;
+Index: src/org/jruby/parser/DefaultRubyParser.y
+===================================================================
+--- src/org/jruby/parser/DefaultRubyParser.y (revision 1128)
++++ src/org/jruby/parser/DefaultRubyParser.y (working copy)
+@@ -1267,13 +1267,13 @@
+ brace_block : tLCURLY {
+ support.pushBlockScope();
+ } opt_block_var compstmt tRCURLY {
+- $$ = new IterNode(support.union($1, $5), $3, support.getCurrentScope(), $4, null);
++ $$ = new IterNode(support.union($<ISourcePositionHolder>0, $5), $3, support.getCurrentScope(), $4, null);
+ support.popCurrentScope();
+ }
+ | kDO {
+ support.pushBlockScope();
+ } opt_block_var compstmt kEND {
+- $$ = new IterNode(support.union($1, $5), $3, support.getCurrentScope(), $4, null);
++ $$ = new IterNode(support.union($<ISourcePositionHolder>0, $5), $3, support.getCurrentScope(), $4, null);
+ support.popCurrentScope();
+ }
+
Added: trunk/org.jruby/patches/method_args.patch
===================================================================
--- trunk/org.jruby/patches/method_args.patch (rev 0)
+++ trunk/org.jruby/patches/method_args.patch 2007-01-29 09:09:18 UTC (rev 1890)
@@ -0,0 +1,42 @@
+Index: src/org/jruby/parser/ParserSupport.java
+===================================================================
+--- src/org/jruby/parser/ParserSupport.java (revision 1135)
++++ src/org/jruby/parser/ParserSupport.java (working copy)
+@@ -238,7 +238,7 @@
+ } else {
+ switch (IdUtil.getVarType(id)) {
+ case IdUtil.LOCAL_VAR:
+- return currentScope.assign(lhs.getPosition(), id, value);
++ return currentScope.assign(value != null ? union(lhs, value) : lhs.getPosition(), id, value);
+ case IdUtil.CONSTANT:
+ if (isInDef() || isInSingle()) {
+ throw new SyntaxException(lhs.getPosition(), "dynamic constant assignment");
+Index: src/org/jruby/ast/BlockArgNode.java
+===================================================================
+--- src/org/jruby/ast/BlockArgNode.java (revision 1135)
++++ src/org/jruby/ast/BlockArgNode.java (working copy)
+@@ -83,7 +83,12 @@
+ return name;
+ }
+
++ public void setName(String name) {
++ this.name = name;
++ }
++
+ public List childNodes() {
+ return EMPTY_LIST;
+ }
++
+ }
+Index: src/org/jruby/ast/visitor/rewriter/ReWriteVisitor.java
+===================================================================
+--- src/org/jruby/ast/visitor/rewriter/ReWriteVisitor.java (revision 1135)
++++ src/org/jruby/ast/visitor/rewriter/ReWriteVisitor.java (working copy)
+@@ -1681,6 +1681,7 @@
+ }
+
+ public Instruction visitRootNode(RootNode iVisited) {
++ config.getLocalVariables().addLocalVariable(iVisited.getStaticScope());
+ visitNode(iVisited.getBodyNode());
+ if(config.hasHereDocument()) {
+ config.fetchHereDocument().print();
Added: trunk/org.jruby/patches/visit_rootnode.patch
===================================================================
--- trunk/org.jruby/patches/visit_rootnode.patch (rev 0)
+++ trunk/org.jruby/patches/visit_rootnode.patch 2007-01-29 09:09:18 UTC (rev 1890)
@@ -0,0 +1,61 @@
+Index: src/org/jruby/ast/visitor/AbstractVisitor.java
+===================================================================
+--- src/org/jruby/ast/visitor/AbstractVisitor.java (revision 1135)
++++ src/org/jruby/ast/visitor/AbstractVisitor.java (working copy)
+@@ -34,7 +34,9 @@
+ import org.jruby.ast.AndNode;
+ import org.jruby.ast.ArgsCatNode;
+ import org.jruby.ast.ArgsNode;
++import org.jruby.ast.ArgsPushNode;
+ import org.jruby.ast.ArrayNode;
++import org.jruby.ast.AttrAssignNode;
+ import org.jruby.ast.BackRefNode;
+ import org.jruby.ast.BeginNode;
+ import org.jruby.ast.BignumNode;
+@@ -130,7 +132,7 @@
+ * @author jpetersen
+ */
+ public abstract class AbstractVisitor implements NodeVisitor {
+-
++
+ /**
+ * This method is called by default for each visited Node.
+ */
+@@ -515,4 +517,12 @@
+ public Instruction visitSymbolNode(SymbolNode iVisited) {
+ return visitNode(iVisited);
+ }
++
++ public Instruction visitArgsPushNode(ArgsPushNode iVisited) {
++ return visitNode(iVisited);
++ }
++
++ public Instruction visitAttrAssignNode(AttrAssignNode iVisited) {
++ return visitNode(iVisited);
++ }
+ }
+Index: src/org/jruby/ast/visitor/NodeVisitor.java
+===================================================================
+--- src/org/jruby/ast/visitor/NodeVisitor.java (revision 1135)
++++ src/org/jruby/ast/visitor/NodeVisitor.java (working copy)
+@@ -140,7 +140,7 @@
+ public Instruction visitAndNode(AndNode iVisited);
+ public Instruction visitArgsNode(ArgsNode iVisited);
+ public Instruction visitArgsCatNode(ArgsCatNode iVisited);
+- public Instruction visitArgsPushNode(ArgsPushNode node);
++ public Instruction visitArgsPushNode(ArgsPushNode iVisited);
+ public Instruction visitArrayNode(ArrayNode iVisited);
+ public Instruction visitAttrAssignNode(AttrAssignNode iVisited);
+ public Instruction visitBackRefNode(BackRefNode iVisited);
+Index: src/org/jruby/ast/visitor/DefaultIteratorVisitor.java
+===================================================================
+--- src/org/jruby/ast/visitor/DefaultIteratorVisitor.java (revision 1135)
++++ src/org/jruby/ast/visitor/DefaultIteratorVisitor.java (working copy)
+@@ -589,6 +589,7 @@
+
+ public Instruction visitRootNode(RootNode iVisited) {
+ iVisited.accept(_Payload);
++ iVisited.getBodyNode().accept(this);
+ return null;
+ }
+
Modified: trunk/org.jruby/src.zip
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-26 15:42:27
|
Revision: 1889
http://svn.sourceforge.net/rubyeclipse/?rev=1889&view=rev
Author: cawilliams
Date: 2007-01-26 07:24:29 -0800 (Fri, 26 Jan 2007)
Log Message:
-----------
add translation string
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties 2007-01-26 15:13:27 UTC (rev 1888)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties 2007-01-26 15:24:29 UTC (rev 1889)
@@ -24,6 +24,7 @@
VMLibraryBlock_6=Re&move
VMLibraryBlock_7=Add E&xternal Folders...
VMLibraryBlock_9=&Restore Default
+VMLibraryBlock_10=Folder Selection
VMLibraryBlock_Libraries_cannot_be_empty__1=Libraries cannot be empty.
LibraryStandin_0=System library does not exist: {0}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-26 15:13:30
|
Revision: 1888
http://svn.sourceforge.net/rubyeclipse/?rev=1888&view=rev
Author: cawilliams
Date: 2007-01-26 07:13:27 -0800 (Fri, 26 Jan 2007)
Log Message:
-----------
expose package that should be exposed (and is being used by murphee's JRuby extension plugin)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF
Modified: trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF 2007-01-26 14:44:51 UTC (rev 1887)
+++ trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF 2007-01-26 15:13:27 UTC (rev 1888)
@@ -35,6 +35,7 @@
org.rubypeople.rdt.ui.rubyeditor,
org.rubypeople.rdt.ui.text,
org.rubypeople.rdt.ui.text.folding,
+ org.rubypeople.rdt.ui.text.hyperlinks,
org.rubypeople.rdt.ui.text.ruby.hover,
org.rubypeople.rdt.ui.wizards
Require-Bundle: org.eclipse.ui.ide,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-26 14:45:03
|
Revision: 1887
http://svn.sourceforge.net/rubyeclipse/?rev=1887&view=rev
Author: cawilliams
Date: 2007-01-26 06:44:51 -0800 (Fri, 26 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java 2007-01-25 20:03:44 UTC (rev 1886)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java 2007-01-26 14:44:51 UTC (rev 1887)
@@ -48,8 +48,10 @@
import org.rubypeople.rdt.core.IRubyModelStatusConstants;
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.ISourceFolderRoot;
import org.rubypeople.rdt.core.ISourceRange;
import org.rubypeople.rdt.core.IType;
+import org.rubypeople.rdt.core.RubyConventions;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.core.WorkingCopyOwner;
@@ -150,21 +152,28 @@
}
protected IStatus validateRubyScript(IResource resource) {
- // FIXME Validate the file and name!
- return RubyModelStatus.VERIFIED_OK;
+ ISourceFolderRoot root = getSourceFolderRoot();
+ // root never null as validation is not done for working copies
+ if (resource != null) {
+ char[][] inclusionPatterns = ((SourceFolderRoot)root).fullInclusionPatternChars();
+ char[][] exclusionPatterns = ((SourceFolderRoot)root).fullExclusionPatternChars();
+ if (Util.isExcluded(resource, inclusionPatterns, exclusionPatterns))
+ return new RubyModelStatus(IRubyModelStatusConstants.ELEMENT_NOT_ON_CLASSPATH, this);
+ if (!resource.isAccessible())
+ return new RubyModelStatus(IRubyModelStatusConstants.ELEMENT_DOES_NOT_EXIST, this);
+ }
+ return RubyConventions.validateRubyScriptName(getElementName());
}
/**
* @see IRubyScript#getElementAt(int)
*/
public IRubyElement getElementAt(int position) throws RubyModelException {
-
IRubyElement e= getSourceElementAt(position);
if (e == this) {
return null;
- } else {
- return e;
}
+ return e;
}
public String getElementName() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-25 20:03:49
|
Revision: 1886
http://svn.sourceforge.net/rubyeclipse/?rev=1886&view=rev
Author: cawilliams
Date: 2007-01-25 12:03:44 -0800 (Thu, 25 Jan 2007)
Log Message:
-----------
try to move common code for resolving a type name to a type into RubyElementrequestor...
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
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/OpenEditorAtLineAction.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/wizards/RubyNewTestCaseWizardPage.java
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-01-25 19:34:32 UTC (rev 1885)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-01-25 20:03:44 UTC (rev 1886)
@@ -4,9 +4,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
-import java.util.StringTokenizer;
import org.jruby.ast.ClassNode;
import org.jruby.ast.ClassVarAsgnNode;
@@ -26,15 +24,13 @@
import org.rubypeople.rdt.core.CompletionProposal;
import org.rubypeople.rdt.core.CompletionRequestor;
import org.rubypeople.rdt.core.Flags;
-import org.rubypeople.rdt.core.IImportDeclaration;
import org.rubypeople.rdt.core.IMethod;
import org.rubypeople.rdt.core.IParent;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.IRubyScript;
-import org.rubypeople.rdt.core.ISourceFolder;
-import org.rubypeople.rdt.core.ISourceFolderRoot;
import org.rubypeople.rdt.core.IType;
+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.RubyType;
@@ -100,76 +96,21 @@
} else { // method or variable
ITypeInferrer inferrer = new DefaultTypeInferrer();
List<ITypeGuess> guesses = inferrer.infer(source.toString(), offset);
-
- IRubyProject rubyProject = script.getRubyProject();
- ISourceFolderRoot[] roots = rubyProject.getSourceFolderRoots();
- // ILoadpathEntry[] loadpaths =
- // rubyProject.getResolvedLoadpath(true);
- for (int i = 0; i < roots.length; i++) {
- ISourceFolderRoot root = roots[i];
- IImportDeclaration[] imports = script.getImports();
- for (int j = 0; j < imports.length; j++) {
- String path = imports[j].getElementName();
- StringTokenizer tokenizer = new StringTokenizer(path, "\\/");
- List<String> tokens = new ArrayList<String>();
- while(tokenizer.hasMoreTokens()) {
- tokens.add(tokenizer.nextToken());
- }
- String name = tokens.remove(tokens.size() - 1) + ".rb";
- String[] pckgs = (String[]) tokens.toArray(new String[tokens.size()]);
- ISourceFolder folder = root.getSourceFolder(pckgs);
- if (!folder.exists()) continue;
- IRubyScript otherScript = folder.getRubyScript(name);
- if (!otherScript.exists()) continue;
- List<IType> types = getTypes(otherScript);
- for (IType type : types) {
- for (ITypeGuess guess : guesses) {
- if (guess.getType().equals(type.getElementName())) {
- IMethod[] methods = type.getMethods();
- for(int x = 0; x < methods.length; x++) {
- addProposal(replaceStart, CompletionProposal.METHOD_REF, methods[x].getElementName());
- }
- }
- }
- }
+ RubyElementRequestor requestor = new RubyElementRequestor(script);
+ for (ITypeGuess guess : guesses) {
+ String name = guess.getType();
+ IType[] types = requestor.findType(name);
+ for (int i = 0; i < types.length; i++) {
+ suggestMethods(replaceStart, guess.getConfidence(), types[i]);
}
}
-// bruteForceMethodSuggestion(script, replaceStart, guesses);
+ // FIXME Traverse the IRubyElement model, not nodes (and don't reparse!)
if (!isMethod)
getDocumentsRubyElementsInScope(script, source.toString(), offset, replaceStart);
}
this.requestor.endReporting();
}
- private List<IType> getTypes(IParent script) {
- List<IType> types = new ArrayList<IType>();
- try {
- IRubyElement[] children = script.getChildren();
- for (int i = 0; i < children.length; i++) {
- if (children[i].isType(IRubyElement.TYPE)) {
- types.add((IType) children[i]);
- }
- if (children[i] instanceof IParent) {
- types.addAll(getTypes((IParent) children[i]));
- }
- }
- } catch (RubyModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return types;
- }
-
- private void bruteForceMethodSuggestion(IRubyScript script, int replaceStart, List<ITypeGuess> guesses) throws RubyModelException {
- RubyElementRequestor completer = new RubyElementRequestor(script.getRubyProject());
- // TODO Search the loadpath + imports!
- for (Iterator iter = guesses.iterator(); iter.hasNext();) {
- ITypeGuess guess = (ITypeGuess) iter.next();
- IType type = completer.findType(guess.getType());
- suggestMethods(replaceStart, completer, guess, type);
- }
- }
-
private void suggestTypeNames(int replaceStart) {
List<String> types = ExperimentalIndex.getTypes();
// TODO Remove duplicates? Sort?
@@ -203,29 +144,6 @@
return this.prefix != null && this.prefix.length() > 0 && Character.isUpperCase(this.prefix.charAt(0));
}
- private void suggestMethods(int replaceStart, RubyElementRequestor completer, ITypeGuess guess, IType type) throws RubyModelException {
- if (type == null)
- return;
-
- suggestMethods(replaceStart, guess.getConfidence(), type);
- // Now grab methods from all the included modules
- String[] modules = type.getIncludedModuleNames();
- if (modules != null) {
- for (int x = 0; x < modules.length; x++) {
- IType tmpType = completer.findType(modules[x]);
- suggestMethods(replaceStart, guess.getConfidence(), tmpType);
- }
- }
- String superClass = type.getSuperclassName();
- if (superClass == null)
- return;
- // FIXME This shouldn't happen! Object shouldn't be a parent of itself!
- if (type.getElementName().equals("Object") && superClass.equals("Object"))
- return;
- IType parentClass = completer.findType(superClass);
- suggestMethods(replaceStart, completer, guess, parentClass);
- }
-
private void suggestMethods(int replaceStart, int confidence, IType type) throws RubyModelException {
if (type == null)
return;
@@ -318,11 +236,11 @@
getElementsOfType(script.getRubyProject(), new int[] { IRubyElement.GLOBAL }, replaceStart);
addClassesAndModulesInProject(script.getRubyProject(), replaceStart);
} catch (RubyModelException rme) {
- System.out.println("RubyModelException in CompletionEngine::getElementsInScope()");
- rme.printStackTrace();
+ RubyCore.log(rme);
+ RubyCore.log("RubyModelException in CompletionEngine::getElementsInScope()");
} catch (SyntaxException se) {
- System.out.println("SyntaxError in CompletionEngine::getElementsInScope()");
- se.printStackTrace();
+ RubyCore.log(se);
+ RubyCore.log("SyntaxError in CompletionEngine::getElementsInScope()");
}
}
@@ -520,7 +438,9 @@
System.out.println("Being asked for the type decl node for " + typeName);
// Find the named type
- IType type = findTypeFromAllProjects(typeName, script);
+ RubyElementRequestor requestor = new RubyElementRequestor(script);
+ IType[] types = requestor.findType(typeName);
+ IType type = types[0];
try {
if (type instanceof RubyType) {
@@ -557,18 +477,6 @@
return new ArrayList<Node>(0);
}
- private IType findTypeFromAllProjects(String typeName, IRubyScript rootScript) {
- // Grab the project and all referred projects
- List<IRubyProject> projects = new LinkedList<IRubyProject>();
- projects.add(rootScript.getRubyProject());
- // FIXME Search the loadpaths!
- // projects.addAll(rootScript.getRubyProject().getReferencedProjects());
-
- // Find the named type
- RubyElementRequestor completer = new RubyElementRequestor(projects.toArray(new IRubyProject[] {}));
- return completer.findType(typeName);
- }
-
private List<String> getIncludedMixinNames(String typeName, IRubyScript script) {
IType rubyType = new RubyType((RubyElement) script, typeName);
@@ -576,9 +484,8 @@
String[] includedModuleNames = rubyType.getIncludedModuleNames();
if (includedModuleNames != null) {
return Arrays.asList(rubyType.getIncludedModuleNames());
- } else {
- return new ArrayList<String>(0);
- }
+ }
+ return new ArrayList<String>(0);
} catch (RubyModelException e) {
return new ArrayList<String>(0);
}
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-01-25 19:34:32 UTC (rev 1885)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java 2007-01-25 20:03:44 UTC (rev 1886)
@@ -1,33 +1,91 @@
package org.rubypeople.rdt.internal.codeassist;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.rubypeople.rdt.core.IImportDeclaration;
+import org.rubypeople.rdt.core.IParent;
+import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyProject;
+import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.ISourceFolder;
+import org.rubypeople.rdt.core.ISourceFolderRoot;
import org.rubypeople.rdt.core.IType;
+import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
public class RubyElementRequestor {
- private IRubyProject[] projects;
+ private static final String SEPARATOR_CHARS = "\\/";
+ private static final String RUBY_FILE_EXTENSION = ".rb";
+ private IRubyScript script;
- public RubyElementRequestor(IRubyProject[] projects) {
- this.projects = projects;
+ public RubyElementRequestor(IRubyScript script) {
+ this.script = script;
}
- public RubyElementRequestor(IRubyProject rubyProject) {
- this(new IRubyProject[] {rubyProject});
+ public IType[] findType(String typeName) {
+ List<IType> types = new ArrayList<IType>();
+ IRubyProject rubyProject = script.getRubyProject();
+ try {
+ ISourceFolderRoot[] roots = rubyProject.getSourceFolderRoots();
+ for (int i = 0; i < roots.length; i++) {
+ types.addAll(getTypeInSourceFolderRoot(roots[i]));
+ }
+ } catch (RubyModelException e) {
+ RubyCore.log(e);
+ }
+ List<IType> matches = new ArrayList<IType>();
+ for (IType type : types) {
+ if (type.getElementName().equals(typeName)) matches.add(type);
+ }
+ return (IType[]) types.toArray(new IType[matches.size()]);
}
- public IType findType(String typeName) {
+ private List<IType> getTypeInSourceFolderRoot(ISourceFolderRoot root) {
+ List<IType> types = new ArrayList<IType>();
try {
- for (int x = 0; x < projects.length; x++) {
- IRubyProject project = projects[x];
- IType type = project.findType(typeName);
- if (type != null)
- return type;
+ IImportDeclaration[] imports = script.getImports();
+ for (int j = 0; j < imports.length; j++) {
+ types.addAll(getTypeInImport(root, imports[j]));
}
} catch (RubyModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ RubyCore.log(e);
}
- return null;
+ return types;
}
+ private List<IType> getTypeInImport(ISourceFolderRoot root, IImportDeclaration importDecl) {
+ String path = importDecl.getElementName();
+ StringTokenizer tokenizer = new StringTokenizer(path, SEPARATOR_CHARS);
+ List<String> tokens = new ArrayList<String>();
+ while(tokenizer.hasMoreTokens()) {
+ tokens.add(tokenizer.nextToken());
+ }
+ String name = tokens.remove(tokens.size() - 1) + RUBY_FILE_EXTENSION;
+ String[] pckgs = (String[]) tokens.toArray(new String[tokens.size()]);
+ ISourceFolder folder = root.getSourceFolder(pckgs);
+ if (!folder.exists()) return new ArrayList<IType>();
+ IRubyScript otherScript = folder.getRubyScript(name);
+ if (!otherScript.exists()) return new ArrayList<IType>();
+ return getTypes(otherScript);
+ }
+
+ private List<IType> getTypes(IParent script) {
+ List<IType> types = new ArrayList<IType>();
+ try {
+ IRubyElement[] children = script.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ if (children[i].isType(IRubyElement.TYPE)) {
+ types.add((IType) children[i]);
+ }
+ if (children[i] instanceof IParent) {
+ types.addAll(getTypes((IParent) children[i]));
+ }
+ }
+ } catch (RubyModelException e) {
+ // ignore
+ }
+ return types;
+ }
}
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-01-25 19:34:32 UTC (rev 1885)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java 2007-01-25 20:03:44 UTC (rev 1886)
@@ -51,14 +51,8 @@
if (element != null) {
return new IRubyElement[] { element };
}
- // TODO Search the required/loaded files first!
- // TODO Search scopes outward!
- // Now search across project for type
- IRubyProject[] projects = new IRubyProject[1];
- projects[0] = script.getRubyProject();
- RubyElementRequestor completer = new RubyElementRequestor(projects);
- IType type = completer.findType(name);
- return new IRubyElement[] { type };
+ RubyElementRequestor completer = new RubyElementRequestor(script);
+ return completer.findType(name);
}
if (isLocalVarRef(selected)) {
// TODO Try the local namespace first!
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/OpenEditorAtLineAction.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/OpenEditorAtLineAction.java 2007-01-25 19:34:32 UTC (rev 1885)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/OpenEditorAtLineAction.java 2007-01-25 20:03:44 UTC (rev 1886)
@@ -29,7 +29,6 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
-import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.internal.debug.ui.RubySourceLocator;
@@ -129,10 +128,6 @@
}
}
- protected IRubyElement findElement(IRubyProject project, String className) throws CoreException {
- return project.findType(className);
- }
-
public boolean isEnabled() {
return getInput() != null;
}
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/wizards/RubyNewTestCaseWizardPage.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/wizards/RubyNewTestCaseWizardPage.java 2007-01-25 19:34:32 UTC (rev 1885)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/wizards/RubyNewTestCaseWizardPage.java 2007-01-25 20:03:44 UTC (rev 1886)
@@ -336,11 +336,6 @@
}
IType type= rproject.findType(classToTestName);
-
- // search in java.lang
-// if (type == null) {
-// type= jproject.findType("java.lang", classToTestName); //$NON-NLS-1$
-// }
return type;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-25 19:34:34
|
Revision: 1885
http://svn.sourceforge.net/rubyeclipse/?rev=1885&view=rev
Author: cawilliams
Date: 2007-01-25 11:34:32 -0800 (Thu, 25 Jan 2007)
Log Message:
-----------
now searches imports based on loadpaths when searching for method completion on a type (I think I also need it to search the local script too)
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/core/ExternalRubyScript.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java
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-01-25 18:26:24 UTC (rev 1884)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-01-25 19:34:32 UTC (rev 1885)
@@ -6,7 +6,7 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.Set;
+import java.util.StringTokenizer;
import org.jruby.ast.ClassNode;
import org.jruby.ast.ClassVarAsgnNode;
@@ -32,17 +32,14 @@
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.ISourceFolder;
import org.rubypeople.rdt.core.ISourceFolderRoot;
import org.rubypeople.rdt.core.IType;
-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.RubyType;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.core.search.ExperimentalIndex;
-import org.rubypeople.rdt.internal.core.symbols.ISymbolFinder;
-import org.rubypeople.rdt.internal.core.symbols.ISymbolTypes;
-import org.rubypeople.rdt.internal.core.symbols.SearchResult;
import org.rubypeople.rdt.internal.ti.DefaultTypeInferrer;
import org.rubypeople.rdt.internal.ti.ITypeGuess;
import org.rubypeople.rdt.internal.ti.ITypeInferrer;
@@ -70,8 +67,9 @@
// if we hit a period, use character before period as offset for
// inferrer
// if we hit a space, use character after space?
- // TODO We need to handle other bad syntax like invoking completion right after an @
- StringBuffer prefix = new StringBuffer();
+ // TODO We need to handle other bad syntax like invoking completion
+ // right after an @
+ StringBuffer tmpPrefix = new StringBuffer();
boolean isMethod = false;
for (int i = offset; i >= 0; i--) {
char curChar = source.charAt(i);
@@ -82,7 +80,7 @@
source.deleteCharAt(i);
offset--;
break;
- }
+ }
offset = i - 1;
break;
}
@@ -90,91 +88,154 @@
offset = i + 1;
break;
}
- prefix.insert(0, curChar);
- }
- this.prefix = prefix.toString();
- if (this.prefix != null) replaceStart -= this.prefix.length();
-
+ tmpPrefix.insert(0, curChar);
+ }
+ this.prefix = tmpPrefix.toString();
+ if (this.prefix != null)
+ replaceStart -= this.prefix.length();
+
if (isConstant()) { // type or constant
- suggestTypeNames(replaceStart);
- suggestConstantNames(replaceStart);
+ suggestTypeNames(replaceStart);
+ suggestConstantNames(replaceStart);
} else { // method or variable
ITypeInferrer inferrer = new DefaultTypeInferrer();
- List<ITypeGuess> guesses = inferrer
- .infer(source.toString(), offset);
- RubyElementRequestor completer = new RubyElementRequestor(script.getRubyProject());
- for (Iterator iter = guesses.iterator(); iter.hasNext();) {
- ITypeGuess guess = (ITypeGuess) iter.next();
- IType type = completer.findType(guess.getType());
- suggestMethods(replaceStart, completer, guess, type);
+ List<ITypeGuess> guesses = inferrer.infer(source.toString(), offset);
+
+ IRubyProject rubyProject = script.getRubyProject();
+ ISourceFolderRoot[] roots = rubyProject.getSourceFolderRoots();
+ // ILoadpathEntry[] loadpaths =
+ // rubyProject.getResolvedLoadpath(true);
+ for (int i = 0; i < roots.length; i++) {
+ ISourceFolderRoot root = roots[i];
+ IImportDeclaration[] imports = script.getImports();
+ for (int j = 0; j < imports.length; j++) {
+ String path = imports[j].getElementName();
+ StringTokenizer tokenizer = new StringTokenizer(path, "\\/");
+ List<String> tokens = new ArrayList<String>();
+ while(tokenizer.hasMoreTokens()) {
+ tokens.add(tokenizer.nextToken());
+ }
+ String name = tokens.remove(tokens.size() - 1) + ".rb";
+ String[] pckgs = (String[]) tokens.toArray(new String[tokens.size()]);
+ ISourceFolder folder = root.getSourceFolder(pckgs);
+ if (!folder.exists()) continue;
+ IRubyScript otherScript = folder.getRubyScript(name);
+ if (!otherScript.exists()) continue;
+ List<IType> types = getTypes(otherScript);
+ for (IType type : types) {
+ for (ITypeGuess guess : guesses) {
+ if (guess.getType().equals(type.getElementName())) {
+ IMethod[] methods = type.getMethods();
+ for(int x = 0; x < methods.length; x++) {
+ addProposal(replaceStart, CompletionProposal.METHOD_REF, methods[x].getElementName());
+ }
+ }
+ }
+ }
+ }
}
- if (!isMethod) getDocumentsRubyElementsInScope(script, source.toString(), offset, replaceStart);
+// bruteForceMethodSuggestion(script, replaceStart, guesses);
+ if (!isMethod)
+ getDocumentsRubyElementsInScope(script, source.toString(), offset, replaceStart);
}
this.requestor.endReporting();
}
+ private List<IType> getTypes(IParent script) {
+ List<IType> types = new ArrayList<IType>();
+ try {
+ IRubyElement[] children = script.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ if (children[i].isType(IRubyElement.TYPE)) {
+ types.add((IType) children[i]);
+ }
+ if (children[i] instanceof IParent) {
+ types.addAll(getTypes((IParent) children[i]));
+ }
+ }
+ } catch (RubyModelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return types;
+ }
+
+ private void bruteForceMethodSuggestion(IRubyScript script, int replaceStart, List<ITypeGuess> guesses) throws RubyModelException {
+ RubyElementRequestor completer = new RubyElementRequestor(script.getRubyProject());
+ // TODO Search the loadpath + imports!
+ for (Iterator iter = guesses.iterator(); iter.hasNext();) {
+ ITypeGuess guess = (ITypeGuess) iter.next();
+ IType type = completer.findType(guess.getType());
+ suggestMethods(replaceStart, completer, guess, type);
+ }
+ }
+
private void suggestTypeNames(int replaceStart) {
List<String> types = ExperimentalIndex.getTypes();
// TODO Remove duplicates? Sort?
for (String name : types) {
- if (this.prefix != null && !name.startsWith(this.prefix)) continue;
- CompletionProposal proposal = new CompletionProposal(
- CompletionProposal.TYPE_REF, name, 100);
- proposal.setReplaceRange(replaceStart, replaceStart + name.length());
- requestor.accept(proposal);
+ if (this.prefix != null && !name.startsWith(this.prefix))
+ continue;
+ addProposal(replaceStart, CompletionProposal.TYPE_REF, name);
}
}
-
+
+ private CompletionProposal addProposal(int replaceStart, int type, String name) {
+ CompletionProposal proposal = new CompletionProposal(type, name, 100);
+ proposal.setReplaceRange(replaceStart, replaceStart + name.length());
+ requestor.accept(proposal);
+ return proposal;
+ }
+
private void suggestConstantNames(int replaceStart) {
List<String> types = ExperimentalIndex.getConstants();
// TODO Remove duplicates? Sort?
for (String name : types) {
- if (this.prefix != null && !name.startsWith(this.prefix)) continue;
- CompletionProposal proposal = new CompletionProposal(
- CompletionProposal.FIELD_REF, name, 100);
+ if (this.prefix != null && !name.startsWith(this.prefix))
+ continue;
+ CompletionProposal proposal = new CompletionProposal(CompletionProposal.FIELD_REF, name, 100);
proposal.setReplaceRange(replaceStart, replaceStart + name.length());
- requestor.accept(proposal);
+ requestor.accept(proposal);
}
}
private boolean isConstant() {
- return this.prefix != null && this.prefix.length() > 0 && Character.isUpperCase(this.prefix
- .charAt(0));
+ return this.prefix != null && this.prefix.length() > 0 && Character.isUpperCase(this.prefix.charAt(0));
}
- private void suggestMethods(int replaceStart, RubyElementRequestor completer, ITypeGuess guess,
- IType type) throws RubyModelException {
+ private void suggestMethods(int replaceStart, RubyElementRequestor completer, ITypeGuess guess, IType type) throws RubyModelException {
if (type == null)
return;
suggestMethods(replaceStart, guess.getConfidence(), type);
// Now grab methods from all the included modules
String[] modules = type.getIncludedModuleNames();
- for (int x = 0; x < modules.length; x++) {
- IType tmpType = completer.findType(modules[x]);
- suggestMethods(replaceStart, guess.getConfidence(),
- tmpType);
+ if (modules != null) {
+ for (int x = 0; x < modules.length; x++) {
+ IType tmpType = completer.findType(modules[x]);
+ suggestMethods(replaceStart, guess.getConfidence(), tmpType);
+ }
}
String superClass = type.getSuperclassName();
+ if (superClass == null)
+ return;
// FIXME This shouldn't happen! Object shouldn't be a parent of itself!
- if (type.getElementName().equals("Object")
- && superClass.equals("Object"))
+ if (type.getElementName().equals("Object") && superClass.equals("Object"))
return;
IType parentClass = completer.findType(superClass);
suggestMethods(replaceStart, completer, guess, parentClass);
}
- private void suggestMethods(int replaceStart, int confidence, IType type)
- throws RubyModelException {
+ private void suggestMethods(int replaceStart, int confidence, IType type) throws RubyModelException {
if (type == null)
return;
IMethod[] methods = type.getMethods();
for (int k = 0; k < methods.length; k++) {
IMethod method = methods[k];
- String name = method.getElementName();
- if (prefix != null && !name.startsWith(prefix)) continue;
- CompletionProposal proposal = new CompletionProposal(
- CompletionProposal.METHOD_REF, name, confidence);
+ String name = method.getElementName();
+ if (prefix != null && !name.startsWith(prefix))
+ continue;
+ CompletionProposal proposal = new CompletionProposal(CompletionProposal.METHOD_REF, name, confidence);
proposal.setReplaceRange(replaceStart, replaceStart + name.length());
int flags = Flags.AccDefault;
if (method.isSingleton()) {
@@ -197,69 +258,74 @@
requestor.accept(proposal);
}
}
-
+
/**
* Gets all the distinct elements in the current RubyScript
- * @param offset
- * @param replaceStart
*
+ * @param offset
+ * @param replaceStart
+ *
* @return a List of the names of all the elements in the current RubyScript
*/
- private void getDocumentsRubyElementsInScope(IRubyScript script, String source, int offset, int replaceStart) {
- try {
- // FIXME Try to stop all the multiple re-parsing of the source! Can we parse once and pass the root node around?
+ private void getDocumentsRubyElementsInScope(IRubyScript script, String source, int offset, int replaceStart) {
+ try {
+ // FIXME Try to stop all the multiple re-parsing of the source! Can
+ // we parse once and pass the root node around?
// Parse
Node rootNode = (new RubyParser()).parse(source);
- if ( rootNode == null ) { return; }
+ if (rootNode == null) {
+ return;
+ }
// Find the enclosing method to get locals and args
Node enclosingMethodNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(rootNode, offset, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- return ( node instanceof DefnNode || node instanceof DefsNode );
+ return (node instanceof DefnNode || node instanceof DefsNode);
}
});
// Add local vars and arguments
// Add local vars and arguments
- if ( enclosingMethodNode != null && enclosingMethodNode instanceof MethodDefNode) {
+ if (enclosingMethodNode != null && enclosingMethodNode instanceof MethodDefNode) {
StaticScope scope = ((MethodDefNode) enclosingMethodNode).getScope();
- if ( scope != null && scope.getVariables().length > 0 ) {
- List locals = Arrays.asList (scope.getVariables());
+ if (scope != null && scope.getVariables().length > 0) {
+ List locals = Arrays.asList(scope.getVariables());
for (Iterator iter = locals.iterator(); iter.hasNext();) {
String local = (String) iter.next();
- if (prefix != null && !local.startsWith(prefix)) continue;
- CompletionProposal proposal = new CompletionProposal(
- CompletionProposal.LOCAL_VARIABLE_REF, local, 100);
+ if (prefix != null && !local.startsWith(prefix))
+ continue;
+ CompletionProposal proposal = new CompletionProposal(CompletionProposal.LOCAL_VARIABLE_REF, local, 100);
proposal.setReplaceRange(replaceStart, replaceStart + local.length());
- requestor.accept(proposal);
+ requestor.accept(proposal);
}
}
}
- // Find the enclosing type (class or module) to get instance and classvars from
+ // Find the enclosing type (class or module) to get instance and
+ // classvars from
Node enclosingTypeNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(rootNode, offset, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- return ( node instanceof ClassNode || node instanceof ModuleNode );
+ return (node instanceof ClassNode || node instanceof ModuleNode);
}
});
// Add members from enclosing type
- if ( enclosingTypeNode != null ) {
- getMembersAvailableInsideType( enclosingTypeNode, script, replaceStart );
+ if (enclosingTypeNode != null) {
+ getMembersAvailableInsideType(enclosingTypeNode, script, replaceStart);
}
// Add all globals, classes, and modules
- getElementsOfType( script.getRubyProject(), new int[] { IRubyElement.GLOBAL }, replaceStart);
- addClassesAndModulesInProject( script.getRubyProject(), replaceStart );
- } catch ( RubyModelException rme ) {
+ getElementsOfType(script.getRubyProject(), new int[] { IRubyElement.GLOBAL }, replaceStart);
+ addClassesAndModulesInProject(script.getRubyProject(), replaceStart);
+ } catch (RubyModelException rme) {
System.out.println("RubyModelException in CompletionEngine::getElementsInScope()");
rme.printStackTrace();
- } catch ( SyntaxException se ) {
+ } catch (SyntaxException se) {
System.out.println("SyntaxError in CompletionEngine::getElementsInScope()");
se.printStackTrace();
}
}
-
+
private void addClassesAndModulesInProject(IRubyProject project, int replaceStart) {
getElementsOfType(project, new int[] { IRubyElement.TYPE }, replaceStart);
}
@@ -267,17 +333,19 @@
private void getElementsOfType(IParent element, int[] types, int replaceStart) {
try {
IRubyElement[] elements = element.getChildren();
- if (elements == null) return;
+ if (elements == null)
+ return;
for (int x = 0; x < elements.length; x++) {
IRubyElement child = elements[x];
for (int i = 0; i < types.length; i++) {
- if (child.getElementType() != types[i]) continue;
+ if (child.getElementType() != types[i])
+ continue;
String name = child.getElementName();
- if (prefix != null && !name.startsWith(prefix)) continue;
- CompletionProposal proposal = new CompletionProposal(
- getCompletionProposalType(child), name, 100);
+ if (prefix != null && !name.startsWith(prefix))
+ continue;
+ CompletionProposal proposal = new CompletionProposal(getCompletionProposalType(child), name, 100);
proposal.setReplaceRange(replaceStart, replaceStart + name.length());
- requestor.accept(proposal);
+ requestor.accept(proposal);
}
if (child instanceof IParent)
getElementsOfType((IParent) child, types, replaceStart);
@@ -286,7 +354,7 @@
e.printStackTrace();
}
}
-
+
private int getCompletionProposalType(IRubyElement child) {
switch (child.getElementType()) {
case IRubyElement.DYNAMIC_VAR:
@@ -305,194 +373,208 @@
}
/**
- * Gets the members available inside a type node (ModuleNode, ClassNode):
- * - Instance variables
- * - Class variables
- * - Methods
+ * Gets the members available inside a type node (ModuleNode, ClassNode): -
+ * Instance variables - Class variables - Methods
*
* @param typeNode
* @return
*/
private void getMembersAvailableInsideType(Node typeNode, IRubyScript script, int replaceStart) throws RubyModelException {
- if ( typeNode == null ) { return; }
-
+ if (typeNode == null) {
+ return;
+ }
+
// Get type name
String typeName = null;
- if ( typeNode instanceof ClassNode ) { typeName = ((Colon2Node)((ClassNode)typeNode).getCPath()).getName(); }
- if ( typeNode instanceof ModuleNode ) { typeName = ((Colon2Node)((ModuleNode)typeNode).getCPath()).getName(); }
- if ( typeName == null ) { return; }
-
- // XXX rubyType may not be in script, but rather be defined in another script
-// IType rubyType = new RubyType( (RubyElement)script, typeName );
- //Better method:
+ if (typeNode instanceof ClassNode) {
+ typeName = ((Colon2Node) ((ClassNode) typeNode).getCPath()).getName();
+ }
+ if (typeNode instanceof ModuleNode) {
+ typeName = ((Colon2Node) ((ModuleNode) typeNode).getCPath()).getName();
+ }
+ if (typeName == null) {
+ return;
+ }
+
+ // XXX rubyType may not be in script, but rather be defined in another
+ // script
+ // IType rubyType = new RubyType( (RubyElement)script, typeName );
+ // Better method:
// Find the named type
-// IType rubyType = findTypeFromAllProjects(typeName, script);
+ // IType rubyType = findTypeFromAllProjects(typeName, script);
-// System.out.println(" -- Located RubyType info.");
-// System.out.println(" -- Superclass: " + rubyType.getSuperclassName() );
+ // System.out.println(" -- Located RubyType info.");
+ // System.out.println(" -- Superclass: " + rubyType.getSuperclassName()
+ // );
-// if ( rubyType != null ) {
-// String[] includedModuleNames = rubyType.getIncludedModuleNames();
-// if ( includedModuleNames != null ) {
-// for ( String moduleName : rubyType.getIncludedModuleNames() ) {
-// System.out.println(" -- Includes module: " + moduleName);
-// }
-// }
-// }
-
-
-
+ // if ( rubyType != null ) {
+ // String[] includedModuleNames = rubyType.getIncludedModuleNames();
+ // if ( includedModuleNames != null ) {
+ // for ( String moduleName : rubyType.getIncludedModuleNames() ) {
+ // System.out.println(" -- Includes module: " + moduleName);
+ // }
+ // }
+ // }
+
// Get superclass and add its public members
- List<Node> superclassNodes = getSuperclassNodes( typeNode, script );
- for ( Node superclassNode : superclassNodes ) {
- getMembersAvailableInsideType( superclassNode, script, replaceStart );
+ List<Node> superclassNodes = getSuperclassNodes(typeNode, script);
+ for (Node superclassNode : superclassNodes) {
+ getMembersAvailableInsideType(superclassNode, script, replaceStart);
}
-
+
// Get public members of mixins
- List<String> mixinNames = getIncludedMixinNames( typeName, script );
- for ( String mixinName : mixinNames ) {
- List<Node> mixinDeclarations = getTypeDeclarationNodes( mixinName, script );
- for ( Node mixinDeclaration : mixinDeclarations ) {
- getMembersAvailableInsideType( mixinDeclaration, script, replaceStart );
+ List<String> mixinNames = getIncludedMixinNames(typeName, script);
+ for (String mixinName : mixinNames) {
+ List<Node> mixinDeclarations = getTypeDeclarationNodes(mixinName, script);
+ for (Node mixinDeclaration : mixinDeclarations) {
+ getMembersAvailableInsideType(mixinDeclaration, script, replaceStart);
}
}
-
+
// Get instance and class variables available in the enclosing type
List<Node> instanceAndClassVars = ScopedNodeLocator.Instance().findNodesInScope(typeNode, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- return ( node instanceof InstVarNode ||
- node instanceof InstAsgnNode ||
- node instanceof ClassVarNode ||
- node instanceof ClassVarDeclNode ||
- node instanceof ClassVarAsgnNode );
+ return (node instanceof InstVarNode || node instanceof InstAsgnNode || node instanceof ClassVarNode || node instanceof ClassVarDeclNode || node instanceof ClassVarAsgnNode);
}
});
-
- if ( instanceAndClassVars != null ) {
+
+ if (instanceAndClassVars != null) {
// Get the unique names of instance and class variables
- for ( Node varNode : instanceAndClassVars ) {
+ for (Node varNode : instanceAndClassVars) {
String name = getNameReflectively(varNode);
- if ( name == null ) continue;
- if (prefix != null && !name.startsWith(prefix)) continue;
-
+ if (name == null)
+ continue;
+ if (prefix != null && !name.startsWith(prefix))
+ continue;
+
CompletionProposal proposal = new CompletionProposal(CompletionProposal.FIELD_REF, name, 100);
proposal.setReplaceRange(replaceStart, replaceStart + name.length());
requestor.accept(proposal);
}
}
-
+
// Get method names defined by DefnNodes and DefsNodes
List<Node> methodDefinitions = ScopedNodeLocator.Instance().findNodesInScope(typeNode, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- return ( node instanceof DefnNode ) || ( node instanceof DefsNode );
+ return (node instanceof DefnNode) || (node instanceof DefsNode);
}
});
- for ( Node methodDefinition : methodDefinitions ) {
+ for (Node methodDefinition : methodDefinitions) {
String name = null;
- if ( methodDefinition instanceof DefnNode ) { name = ((DefnNode)methodDefinition).getName(); }
- if ( methodDefinition instanceof DefsNode ) { name = ((DefsNode)methodDefinition).getName(); }
- if (name == null) continue;
- if (prefix != null && !name.startsWith(prefix)) continue;
+ if (methodDefinition instanceof DefnNode) {
+ name = ((DefnNode) methodDefinition).getName();
+ }
+ if (methodDefinition instanceof DefsNode) {
+ name = ((DefsNode) methodDefinition).getName();
+ }
+ if (name == null)
+ continue;
+ if (prefix != null && !name.startsWith(prefix))
+ continue;
CompletionProposal proposal = new CompletionProposal(CompletionProposal.METHOD_REF, name, 100);
proposal.setReplaceRange(replaceStart, replaceStart + name.length());
requestor.accept(proposal);
}
-
+
// Get instance and class vars defined by [c]attr_* calls
List<String> attrs = AttributeLocator.Instance().findInstanceAttributesInScope(typeNode);
- for (Iterator iter = attrs.iterator(); iter.hasNext(); ) {
+ for (Iterator iter = attrs.iterator(); iter.hasNext();) {
String attr = (String) iter.next();
- if (prefix != null && !attr.startsWith(prefix)) continue;
+ if (prefix != null && !attr.startsWith(prefix))
+ continue;
CompletionProposal proposal = new CompletionProposal(CompletionProposal.FIELD_REF, attr, 100);
proposal.setReplaceRange(replaceStart, replaceStart + attr.length());
requestor.accept(proposal);
}
}
-
+
/**
- * Finds all nodes that declare a type that is a superclass of the specified node. Example:
+ * Finds all nodes that declare a type that is a superclass of the specified
+ * node. Example:
*
- * """
- * class Klass;def meth_1;1;end;end
- * class Klass;def meth_2;2;end;end
+ * """ class Klass;def meth_1;1;end;end class Klass;def meth_2;2;end;end
*
- * class SubKlass < Klass;end
- * """
+ * class SubKlass < Klass;end """
*
- * Issuing getSuperClassNodes() on the ClassNode declaring SubKlass would return two ClassNodes;
- * one for each definition of Klass.
+ * Issuing getSuperClassNodes() on the ClassNode declaring SubKlass would
+ * return two ClassNodes; one for each definition of Klass.
*
- * @param typeNode Node to find superclass nodes of
+ * @param typeNode
+ * Node to find superclass nodes of
* @return List of ClassNode or ModuleNode
*/
- private List<Node> getSuperclassNodes( Node typeNode, IRubyScript script ) {
- if ( typeNode instanceof ClassNode ) {
- Node superNode = ((ClassNode)typeNode).getSuperNode();
- if ( superNode instanceof ConstNode ) {
- String superclassName = ((ConstNode)superNode).getName();
- return getTypeDeclarationNodes( superclassName, script );
+ private List<Node> getSuperclassNodes(Node typeNode, IRubyScript script) {
+ if (typeNode instanceof ClassNode) {
+ Node superNode = ((ClassNode) typeNode).getSuperNode();
+ if (superNode instanceof ConstNode) {
+ String superclassName = ((ConstNode) superNode).getName();
+ return getTypeDeclarationNodes(superclassName, script);
}
- }
+ }
return new ArrayList<Node>();
}
-
+
/** Lookup type declaration nodes */
- private List<Node> getTypeDeclarationNodes( String typeName, IRubyScript script ) {
- System.out.println("Being asked for the type decl node for " + typeName );
-
+ private List<Node> getTypeDeclarationNodes(String typeName, IRubyScript script) {
+ System.out.println("Being asked for the type decl node for " + typeName);
+
// Find the named type
IType type = findTypeFromAllProjects(typeName, script);
-
+
try {
- if ( type instanceof RubyType ) {
+ if (type instanceof RubyType) {
- // FIXME This feels a little hacky and backwards - RubyType.getSource() and then parse... consider reworking the clients to this method to accept RubyTypes or something similar?
+ // FIXME This feels a little hacky and backwards -
+ // RubyType.getSource() and then parse... consider reworking the
+ // clients to this method to accept RubyTypes or something
+ // similar?
// Find source and parse
- RubyType rubyType = (RubyType)type;
+ RubyType rubyType = (RubyType) type;
String source = rubyType.getSource();
-
+
// FIXME Why does the parser balk on \r chars?
source = source.replace('\r', ' ');
- Node rootNode = (new RubyParser()).parse( source );
-
+ Node rootNode = (new RubyParser()).parse(source);
+
// Bail if the parse fails
- if ( rootNode == null ) { return new ArrayList(); }
+ if (rootNode == null) {
+ return new ArrayList();
+ }
- // Return any type declaration nodes in included source
+ // Return any type declaration nodes in included source
return ScopedNodeLocator.Instance().findNodesInScope(rootNode, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- return ( node instanceof ClassNode ) ||
- ( node instanceof ModuleNode );
+ return (node instanceof ClassNode) || (node instanceof ModuleNode);
}
});
}
-
- } catch ( RubyModelException rme ) {
+
+ } catch (RubyModelException rme) {
rme.printStackTrace();
}
-
+
return new ArrayList<Node>(0);
- }
+ }
private IType findTypeFromAllProjects(String typeName, IRubyScript rootScript) {
// Grab the project and all referred projects
List<IRubyProject> projects = new LinkedList<IRubyProject>();
projects.add(rootScript.getRubyProject());
// FIXME Search the loadpaths!
-// projects.addAll(rootScript.getRubyProject().getReferencedProjects());
+ // projects.addAll(rootScript.getRubyProject().getReferencedProjects());
// Find the named type
- RubyElementRequestor completer = new RubyElementRequestor(projects.toArray(new IRubyProject[]{}));
+ RubyElementRequestor completer = new RubyElementRequestor(projects.toArray(new IRubyProject[] {}));
return completer.findType(typeName);
}
-
- private List<String> getIncludedMixinNames( String typeName, IRubyScript script ) {
- IType rubyType = new RubyType( (RubyElement)script, typeName );
-
+
+ private List<String> getIncludedMixinNames(String typeName, IRubyScript script) {
+ IType rubyType = new RubyType((RubyElement) script, typeName);
+
try {
String[] includedModuleNames = rubyType.getIncludedModuleNames();
- if ( includedModuleNames != null ) {
+ if (includedModuleNames != null) {
return Arrays.asList(rubyType.getIncludedModuleNames());
} else {
return new ArrayList<String>(0);
@@ -501,22 +583,24 @@
return new ArrayList<String>(0);
}
}
-
+
/**
* Gets the name of a node by reflectively invoking "getName()" on it;
* helper method just to cut many "instanceof/cast" pairs.
+ *
* @param node
* @return name or null
*/
- // TODO Copy/pasted from DefaultOccurrencesFinder, refactor these two methods to a common location.
- private String getNameReflectively( Node node ) {
+ // TODO Copy/pasted from DefaultOccurrencesFinder, refactor these two
+ // methods to a common location.
+ private String getNameReflectively(Node node) {
try {
- Method getNameMethod = node.getClass().getMethod("getName", new Class[]{});
- Object name = getNameMethod.invoke( node, new Object[0] );
- return (String)name;
+ Method getNameMethod = node.getClass().getMethod("getName", new Class[] {});
+ Object name = getNameMethod.invoke(node, new Object[0]);
+ return (String) name;
} catch (Exception e) {
return null;
}
- }
+ }
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java 2007-01-25 18:26:24 UTC (rev 1884)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java 2007-01-25 19:34:32 UTC (rev 1885)
@@ -52,7 +52,7 @@
@Override
public boolean exists() {
- return ((Openable)getOpenable()).exists();
+ return getFile().exists();
}
/**
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolder.java 2007-01-25 18:26:24 UTC (rev 1884)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolder.java 2007-01-25 19:34:32 UTC (rev 1885)
@@ -6,7 +6,9 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.rubypeople.rdt.core.IRubyElement;
+import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.RubyModelException;
+import org.rubypeople.rdt.internal.core.util.Messages;
import org.rubypeople.rdt.internal.core.util.Util;
public class ExternalSourceFolder extends SourceFolder {
@@ -49,4 +51,11 @@
info.setChildren(children);
return true;
}
+
+ public IRubyScript getRubyScript(String name) {
+ if (!org.rubypeople.rdt.internal.core.util.Util.isRubyLikeFileName(name)) {
+ throw new IllegalArgumentException(Messages.convention_unit_notJavaName);
+ }
+ return new ExternalRubyScript(this, name, DefaultWorkingCopyOwner.PRIMARY);
+ }
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties 2007-01-25 18:26:24 UTC (rev 1884)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties 2007-01-25 19:34:32 UTC (rev 1885)
@@ -180,7 +180,7 @@
### java conventions
convention_unit_nullName = Compilation unit name must not be null
-convention_unit_notJavaName = Compilation unit name must end with .java
+convention_unit_notJavaName = Compilation unit name must end with .rb
convention_classFile_nullName = .class file name must not be null
convention_classFile_notClassFileName = .class file name must end with .class
convention_illegalIdentifier = ''{0}'' is not a valid Java identifier
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java 2007-01-25 18:26:24 UTC (rev 1884)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java 2007-01-25 19:34:32 UTC (rev 1885)
@@ -67,7 +67,9 @@
tryGlobalVarNode(node, guesses);
tryWellKnownMethodCalls(node, guesses);
-
+ if (node instanceof ConstNode) { // if this is a constant, it may be the type name!
+ guesses.add(new BasicTypeGuess(((ConstNode)node).getName(), 100));
+ }
return guesses;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-25 18:26:32
|
Revision: 1884
http://svn.sourceforge.net/rubyeclipse/?rev=1884&view=rev
Author: cawilliams
Date: 2007-01-25 10:26:24 -0800 (Thu, 25 Jan 2007)
Log Message:
-----------
fix concurrency issue by cloning array before returning it
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java 2007-01-25 16:54:46 UTC (rev 1883)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java 2007-01-25 18:26:24 UTC (rev 1884)
@@ -20,8 +20,8 @@
public class ExperimentalIndex implements IElementChangedListener {
private static ExperimentalIndex fgInstance;
- private static List<String> fgConstants;
- private static List<String> fgTypes;
+ private static ArrayList<String> fgConstants;
+ private static ArrayList<String> fgTypes;
private ExperimentalIndex() {
fgTypes = new ArrayList<String>();
@@ -33,13 +33,11 @@
}
public static List<String> getTypes() {
- // XXX We need to handle case where this gets invoked while index is updating (and we get a concurrent modification exception)!
- return Collections.unmodifiableList(fgTypes);
+ return Collections.unmodifiableList((ArrayList<String>)fgTypes.clone()); // clone to avoid concurrent modification when iterating
}
public static List<String> getConstants() {
-// XXX We need to handle case where this gets invoked while index is updating (and we get a concurrent modification exception)!
- return Collections.unmodifiableList(fgConstants);
+ return Collections.unmodifiableList((ArrayList<String>)fgConstants.clone()); // clone to avoid concurrent modification when iterating
}
private void processDelta(IRubyElementDelta delta) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-25 16:54:48
|
Revision: 1883
http://svn.sourceforge.net/rubyeclipse/?rev=1883&view=rev
Author: cawilliams
Date: 2007-01-25 08:54:46 -0800 (Thu, 25 Jan 2007)
Log Message:
-----------
add constants to things to be index in the new experimental index. Also make note of cocncurrency problem that we're gonna run into
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/core/search/ExperimentalIndex.java
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-01-25 16:39:47 UTC (rev 1882)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-01-25 16:54:46 UTC (rev 1883)
@@ -96,15 +96,8 @@
if (this.prefix != null) replaceStart -= this.prefix.length();
if (isConstant()) { // type or constant
- List<String> types = ExperimentalIndex.getTypes();
- // TODO Remove duplicates? Sort?
- for (String name : types) {
- if (this.prefix != null && !name.startsWith(this.prefix)) continue;
- CompletionProposal proposal = new CompletionProposal(
- CompletionProposal.TYPE_REF, name, 100);
- proposal.setReplaceRange(replaceStart, replaceStart + name.length());
- requestor.accept(proposal);
- }
+ suggestTypeNames(replaceStart);
+ suggestConstantNames(replaceStart);
} else { // method or variable
ITypeInferrer inferrer = new DefaultTypeInferrer();
List<ITypeGuess> guesses = inferrer
@@ -120,6 +113,30 @@
this.requestor.endReporting();
}
+ private void suggestTypeNames(int replaceStart) {
+ List<String> types = ExperimentalIndex.getTypes();
+ // TODO Remove duplicates? Sort?
+ for (String name : types) {
+ if (this.prefix != null && !name.startsWith(this.prefix)) continue;
+ CompletionProposal proposal = new CompletionProposal(
+ CompletionProposal.TYPE_REF, name, 100);
+ proposal.setReplaceRange(replaceStart, replaceStart + name.length());
+ requestor.accept(proposal);
+ }
+ }
+
+ private void suggestConstantNames(int replaceStart) {
+ List<String> types = ExperimentalIndex.getConstants();
+ // TODO Remove duplicates? Sort?
+ for (String name : types) {
+ if (this.prefix != null && !name.startsWith(this.prefix)) continue;
+ CompletionProposal proposal = new CompletionProposal(
+ CompletionProposal.FIELD_REF, name, 100);
+ proposal.setReplaceRange(replaceStart, replaceStart + name.length());
+ requestor.accept(proposal);
+ }
+ }
+
private boolean isConstant() {
return this.prefix != null && this.prefix.length() > 0 && Character.isUpperCase(this.prefix
.charAt(0));
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java 2007-01-25 16:39:47 UTC (rev 1882)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java 2007-01-25 16:54:46 UTC (rev 1883)
@@ -18,12 +18,14 @@
import org.rubypeople.rdt.internal.core.RubyModelManager;
public class ExperimentalIndex implements IElementChangedListener {
-
- private static List<String> fgTypes = new ArrayList<String>();
+
private static ExperimentalIndex fgInstance;
-
+ private static List<String> fgConstants;
+ private static List<String> fgTypes;
+
private ExperimentalIndex() {
-
+ fgTypes = new ArrayList<String>();
+ fgConstants = new ArrayList<String>();
}
public void elementChanged(ElementChangedEvent event) {
@@ -31,8 +33,14 @@
}
public static List<String> getTypes() {
+ // XXX We need to handle case where this gets invoked while index is updating (and we get a concurrent modification exception)!
return Collections.unmodifiableList(fgTypes);
}
+
+ public static List<String> getConstants() {
+// XXX We need to handle case where this gets invoked while index is updating (and we get a concurrent modification exception)!
+ return Collections.unmodifiableList(fgConstants);
+ }
private void processDelta(IRubyElementDelta delta) {
IRubyElement element = delta.getElement();
@@ -45,11 +53,7 @@
}
break;
case IRubyElementDelta.REMOVED:
- switch (element.getElementType()) {
- case IRubyElement.TYPE:
- fgTypes.remove(element.getElementName());
- break;
- }
+ removeElement(element);
break;
case IRubyElementDelta.ADDED:
addElement(element);
@@ -57,11 +61,25 @@
}
}
+ void removeElement(IRubyElement element) {
+ switch (element.getElementType()) {
+ case IRubyElement.TYPE:
+ fgTypes.remove(element.getElementName());
+ break;
+ case IRubyElement.CONSTANT:
+ fgConstants.remove(element.getElementName());
+ break;
+ }
+ }
+
void addElement(IRubyElement element) {
switch (element.getElementType()) {
case IRubyElement.TYPE:
fgTypes.add(element.getElementName());
break;
+ case IRubyElement.CONSTANT:
+ fgConstants.add(element.getElementName());
+ break;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-25 16:39:56
|
Revision: 1882
http://svn.sourceforge.net/rubyeclipse/?rev=1882&view=rev
Author: cawilliams
Date: 2007-01-25 08:39:47 -0800 (Thu, 25 Jan 2007)
Log Message:
-----------
add a new experimental index for code completion. This index just keeps track of all the type names. So when we do code completion on types, it pops up the names very quickly.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java 2007-01-25 15:40:44 UTC (rev 1881)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java 2007-01-25 16:39:47 UTC (rev 1882)
@@ -54,6 +54,7 @@
import org.rubypeople.rdt.internal.core.builder.MassIndexUpdaterJob;
import org.rubypeople.rdt.internal.core.builder.RubyBuilder;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
+import org.rubypeople.rdt.internal.core.search.ExperimentalIndex;
import org.rubypeople.rdt.internal.core.symbols.ISymbolFinder;
import org.rubypeople.rdt.internal.core.symbols.SymbolIndex;
import org.rubypeople.rdt.internal.core.util.Util;
@@ -350,6 +351,8 @@
List rubyProjects = Arrays.asList(getRubyProjects());
MassIndexUpdaterJob massUpdater = new MassIndexUpdaterJob(indexUpdater, rubyProjects);
massUpdater.schedule();
+ addElementChangedListener(ExperimentalIndex.instance());
+ ExperimentalIndex.start();
}
/*
@@ -361,6 +364,7 @@
public void stop(BundleContext context) throws Exception {
try {
RubyModelManager.getRubyModelManager().shutdown();
+ removeElementChangedListener(ExperimentalIndex.instance());
} finally {
// ensure we call super.stop as the last thing
super.stop(context);
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-01-25 15:40:44 UTC (rev 1881)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-01-25 16:39:47 UTC (rev 1882)
@@ -6,6 +6,7 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.Set;
import org.jruby.ast.ClassNode;
import org.jruby.ast.ClassVarAsgnNode;
@@ -25,16 +26,23 @@
import org.rubypeople.rdt.core.CompletionProposal;
import org.rubypeople.rdt.core.CompletionRequestor;
import org.rubypeople.rdt.core.Flags;
+import org.rubypeople.rdt.core.IImportDeclaration;
import org.rubypeople.rdt.core.IMethod;
import org.rubypeople.rdt.core.IParent;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.ISourceFolderRoot;
import org.rubypeople.rdt.core.IType;
+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.RubyType;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
+import org.rubypeople.rdt.internal.core.search.ExperimentalIndex;
+import org.rubypeople.rdt.internal.core.symbols.ISymbolFinder;
+import org.rubypeople.rdt.internal.core.symbols.ISymbolTypes;
+import org.rubypeople.rdt.internal.core.symbols.SearchResult;
import org.rubypeople.rdt.internal.ti.DefaultTypeInferrer;
import org.rubypeople.rdt.internal.ti.ITypeGuess;
import org.rubypeople.rdt.internal.ti.ITypeInferrer;
@@ -56,8 +64,6 @@
this.requestor.beginReporting();
if (offset < 0)
offset = 0;
- ITypeInferrer inferrer = new DefaultTypeInferrer();
-
StringBuffer source = new StringBuffer(script.getSource());
int replaceStart = offset + 1;
// Read from offset back until we hit a: space, period
@@ -89,27 +95,36 @@
this.prefix = prefix.toString();
if (this.prefix != null) replaceStart -= this.prefix.length();
- // If the prefix looks like a constant don't bother searching for
- // methods
- if (!(this.prefix != null && this.prefix.length() > 0 && Character.isUpperCase(this.prefix
- .charAt(0)))) {
+ if (isConstant()) { // type or constant
+ List<String> types = ExperimentalIndex.getTypes();
+ // TODO Remove duplicates? Sort?
+ for (String name : types) {
+ if (this.prefix != null && !name.startsWith(this.prefix)) continue;
+ CompletionProposal proposal = new CompletionProposal(
+ CompletionProposal.TYPE_REF, name, 100);
+ proposal.setReplaceRange(replaceStart, replaceStart + name.length());
+ requestor.accept(proposal);
+ }
+ } else { // method or variable
+ ITypeInferrer inferrer = new DefaultTypeInferrer();
List<ITypeGuess> guesses = inferrer
.infer(source.toString(), offset);
- // TODO Grab the project and all referred projects!
- IRubyProject[] projects = new IRubyProject[1];
- projects[0] = script.getRubyProject();
- RubyElementRequestor completer = new RubyElementRequestor(projects);
+ RubyElementRequestor completer = new RubyElementRequestor(script.getRubyProject());
for (Iterator iter = guesses.iterator(); iter.hasNext();) {
ITypeGuess guess = (ITypeGuess) iter.next();
IType type = completer.findType(guess.getType());
suggestMethods(replaceStart, completer, guess, type);
}
+ if (!isMethod) getDocumentsRubyElementsInScope(script, source.toString(), offset, replaceStart);
}
- // FIXME Do we need to call this at all if we know it's a method call we're trying to complete?
- if (!isMethod) getDocumentsRubyElementsInScope(script, source.toString(), offset, replaceStart);
this.requestor.endReporting();
}
+ private boolean isConstant() {
+ return this.prefix != null && this.prefix.length() > 0 && Character.isUpperCase(this.prefix
+ .charAt(0));
+ }
+
private void suggestMethods(int replaceStart, RubyElementRequestor completer, ITypeGuess guess,
IType type) throws RubyModelException {
if (type == null)
@@ -174,13 +189,7 @@
* @return a List of the names of all the elements in the current RubyScript
*/
private void getDocumentsRubyElementsInScope(IRubyScript script, String source, int offset, int replaceStart) {
- try {
- // Get all references projects
- List<IRubyProject> projects = new ArrayList<IRubyProject>();
- projects.add(script.getRubyProject());
- // TODO Search the loadpaths!
-// projects.addAll(script.getRubyProject().getReferencedProjects());
-
+ try {
// FIXME Try to stop all the multiple re-parsing of the source! Can we parse once and pass the root node around?
// Parse
Node rootNode = (new RubyParser()).parse(source);
@@ -223,11 +232,8 @@
}
// Add all globals, classes, and modules
- for (Iterator iter = projects.iterator(); iter.hasNext();) {
- IRubyProject nextProject = (IRubyProject)(iter.next());
- getElementsOfType( nextProject, new int[] { IRubyElement.GLOBAL }, replaceStart);
- addClassesAndModulesInProject( nextProject, replaceStart );
- }
+ getElementsOfType( script.getRubyProject(), new int[] { IRubyElement.GLOBAL }, replaceStart);
+ addClassesAndModulesInProject( script.getRubyProject(), replaceStart );
} catch ( RubyModelException rme ) {
System.out.println("RubyModelException in CompletionEngine::getElementsInScope()");
rme.printStackTrace();
Added: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java 2007-01-25 16:39:47 UTC (rev 1882)
@@ -0,0 +1,112 @@
+package org.rubypeople.rdt.internal.core.search;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.rubypeople.rdt.core.ElementChangedEvent;
+import org.rubypeople.rdt.core.IElementChangedListener;
+import org.rubypeople.rdt.core.IParent;
+import org.rubypeople.rdt.core.IRubyElement;
+import org.rubypeople.rdt.core.IRubyElementDelta;
+import org.rubypeople.rdt.core.IRubyModel;
+import org.rubypeople.rdt.core.RubyModelException;
+import org.rubypeople.rdt.internal.core.RubyModelManager;
+
+public class ExperimentalIndex implements IElementChangedListener {
+
+ private static List<String> fgTypes = new ArrayList<String>();
+ private static ExperimentalIndex fgInstance;
+
+ private ExperimentalIndex() {
+
+ }
+
+ public void elementChanged(ElementChangedEvent event) {
+ processDelta(event.getDelta());
+ }
+
+ public static List<String> getTypes() {
+ return Collections.unmodifiableList(fgTypes);
+ }
+
+ private void processDelta(IRubyElementDelta delta) {
+ IRubyElement element = delta.getElement();
+ switch (delta.getKind()) {
+ case IRubyElementDelta.CHANGED:
+ IRubyElementDelta[] children = delta.getAffectedChildren();
+ for (int i = 0, length = children.length; i < length; i++) {
+ IRubyElementDelta child = children[i];
+ this.processDelta(child);
+ }
+ break;
+ case IRubyElementDelta.REMOVED:
+ switch (element.getElementType()) {
+ case IRubyElement.TYPE:
+ fgTypes.remove(element.getElementName());
+ break;
+ }
+ break;
+ case IRubyElementDelta.ADDED:
+ addElement(element);
+ break;
+ }
+ }
+
+ void addElement(IRubyElement element) {
+ switch (element.getElementType()) {
+ case IRubyElement.TYPE:
+ fgTypes.add(element.getElementName());
+ break;
+ }
+ }
+
+ public static ExperimentalIndex instance() {
+ if (fgInstance == null) {
+ fgInstance = new ExperimentalIndex();
+ }
+ return fgInstance;
+ }
+
+ public static void start() {
+ Job job = new ExperimentalIndexJob(instance());
+ job.schedule();
+ }
+
+ private static class ExperimentalIndexJob extends Job {
+ private ExperimentalIndex index;
+
+ public ExperimentalIndexJob(ExperimentalIndex index) {
+ super("Experimental Index Job");
+ this.index = index;
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ IRubyModel model = RubyModelManager.getRubyModelManager().getRubyModel();
+ addChildren(model);
+ return Status.OK_STATUS;
+ }
+
+ private void addChildren(IParent parent) {
+ try {
+ IRubyElement[] children = parent.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ index.addElement(children[i]);
+ if (children[i] instanceof IParent) {
+ IParent newParent = (IParent) children[i];
+ addChildren(newParent);
+ }
+ }
+ } catch (RubyModelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-25 15:40:46
|
Revision: 1881
http://svn.sourceforge.net/rubyeclipse/?rev=1881&view=rev
Author: cawilliams
Date: 2007-01-25 07:40:44 -0800 (Thu, 25 Jan 2007)
Log Message:
-----------
fix how we deal with source folder roots inside our wizards (now that we have external ones)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewContainerWizardPage.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewElementWizardPage.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java 2007-01-25 14:22:26 UTC (rev 1880)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java 2007-01-25 15:40:44 UTC (rev 1881)
@@ -98,6 +98,17 @@
* @see RubyCore#getDefaultOptions()
*/
Map getOptions(boolean inheritRubyCoreOptions);
+
+ /**
+ * Returns all of the existing source folder roots that exist
+ * on the loadpath, in the order they are defined by the loadpath.
+ *
+ * @return all of the existing source folder roots that exist
+ * on the loadpath
+ * @exception RubyModelException if this element does not exist or if an
+ * exception occurs while accessing its corresponding resource
+ */
+ ISourceFolderRoot[] getAllSourceFolderRoots() throws RubyModelException;
public abstract Object[] getNonRubyResources() throws RubyModelException;
@@ -131,4 +142,6 @@
throws RubyModelException;
public abstract ISourceFolderRoot getSourceFolderRoot(String rootPath);
+
+ public abstract ISourceFolderRoot findSourceFolderRoot(IPath path) throws RubyModelException;
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-01-25 14:22:26 UTC (rev 1880)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-01-25 15:40:44 UTC (rev 1881)
@@ -2316,4 +2316,36 @@
public ILoadpathEntry[] decodeLoadpath(String xmlClasspath, boolean createMarker, boolean logProblems) {
return decodeLoadpath(xmlClasspath, createMarker, logProblems, null/*not interested in unknown elements*/);
}
+
+ public ISourceFolderRoot findSourceFolderRoot(IPath path) throws RubyModelException {
+ return findSourceFolderRoot0(RubyProject.canonicalizedPath(path));
+ }
+
+ /*
+ * no path canonicalization
+ */
+ public ISourceFolderRoot findSourceFolderRoot0(IPath path)
+ throws RubyModelException {
+
+ ISourceFolderRoot[] allRoots = this.getAllSourceFolderRoots();
+ if (!path.isAbsolute()) {
+ throw new IllegalArgumentException(Messages.path_mustBeAbsolute);
+ }
+ for (int i= 0; i < allRoots.length; i++) {
+ ISourceFolderRoot classpathRoot= allRoots[i];
+ if (classpathRoot.getPath().equals(path)) {
+ return classpathRoot;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @see IRubyProject
+ */
+ public ISourceFolderRoot[] getAllSourceFolderRoots()
+ throws RubyModelException {
+
+ return getAllSourceFolderRoots(null /*no reverse map*/);
+ }
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewContainerWizardPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewContainerWizardPage.java 2007-01-25 14:22:26 UTC (rev 1880)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewContainerWizardPage.java 2007-01-25 15:40:44 UTC (rev 1881)
@@ -14,6 +14,7 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Composite;
@@ -252,8 +253,8 @@
status.setError(Messages.format(NewWizardMessages.NewContainerWizardPage_error_ProjectClosed, proj.getFullPath().toString()));
return status;
}
- IRubyProject jproject= RubyCore.create(proj);
- fCurrRoot= jproject.getSourceFolderRoot(res);
+ IRubyProject rproject= RubyCore.create(proj);
+ fCurrRoot= rproject.getSourceFolderRoot(res);
if (res.exists()) {
try {
if (!proj.hasNature(RubyCore.NATURE_ID)) {
@@ -264,7 +265,7 @@
}
return status;
}
- if (!jproject.isOnLoadpath(fCurrRoot)) {
+ if (!rproject.isOnLoadpath(fCurrRoot)) {
status.setWarning(Messages.format(NewWizardMessages.NewContainerWizardPage_warning_NotOnLoadPath, str));
}
} catch (CoreException e) {
@@ -308,21 +309,21 @@
if (elem != null) {
initRoot= RubyModelUtil.getSourceFolderRoot(elem);
try {
- if (initRoot == null) {
- IRubyProject jproject= elem.getRubyProject();
- if (jproject != null) {
+ if (initRoot == null || initRoot.isExternal()) {
+ IRubyProject rproject= elem.getRubyProject();
+ if (rproject != null) {
initRoot= null;
- if (jproject.exists()) {
- ISourceFolderRoot[] roots= jproject.getSourceFolderRoots();
+ if (rproject.exists()) {
+ ISourceFolderRoot[] roots= rproject.getSourceFolderRoots();
for (int i= 0; i < roots.length; i++) {
-
+ if (!roots[i].isExternal()) {
initRoot= roots[i];
break;
-
+ }
}
}
if (initRoot == null) {
- initRoot= jproject.getSourceFolderRoot(jproject.getResource());
+ initRoot= rproject.getSourceFolderRoot(rproject.getResource());
}
}
}
@@ -385,10 +386,33 @@
protected ISourceFolderRoot chooseContainer() {
IRubyElement initElement= getSourceFolderRoot();
Class[] acceptedClasses= new Class[] { IRubyProject.class, ISourceFolderRoot.class };
- TypedElementSelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, false);
+ TypedElementSelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, false) {
+ public boolean isSelectedValid(Object element) {
+ try {
+ if (element instanceof IRubyProject) {
+ IRubyProject jproject= (IRubyProject)element;
+ IPath path= jproject.getProject().getFullPath();
+ return (jproject.findSourceFolderRoot(path) != null);
+ } else if (element instanceof ISourceFolderRoot) {
+ return (!((ISourceFolderRoot)element).isExternal());
+ }
+ return true;
+ } catch (RubyModelException e) {
+ RubyPlugin.log(e.getStatus()); // just log, no UI in validation
+ }
+ return false;
+ }
+ };
- acceptedClasses= new Class[] { IRubyModel.class, IRubyProject.class, ISourceFolderRoot.class };
- ViewerFilter filter= new TypedViewerFilter(acceptedClasses);
+ acceptedClasses= new Class[] { IRubyModel.class, ISourceFolderRoot.class, IRubyProject.class };
+ ViewerFilter filter= new TypedViewerFilter(acceptedClasses) {
+ public boolean select(Viewer viewer, Object parent, Object element) {
+ if (element instanceof ISourceFolderRoot) {
+ return (!((ISourceFolderRoot)element).isExternal());
+ }
+ return super.select(viewer, parent, element);
+ }
+ };
StandardRubyElementContentProvider provider= new StandardRubyElementContentProvider();
ILabelProvider labelProvider= new RubyElementLabelProvider(RubyElementLabelProvider.SHOW_DEFAULT);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewElementWizardPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewElementWizardPage.java 2007-01-25 14:22:26 UTC (rev 1880)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewElementWizardPage.java 2007-01-25 15:40:44 UTC (rev 1881)
@@ -25,7 +25,7 @@
* Clients may subclass.
* </p>
*
- * @since 2.0
+ * @since 0.9.0
*/
public abstract class NewElementWizardPage extends WizardPage {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-25 14:22:27
|
Revision: 1880
http://svn.sourceforge.net/rubyeclipse/?rev=1880&view=rev
Author: cawilliams
Date: 2007-01-25 06:22:26 -0800 (Thu, 25 Jan 2007)
Log Message:
-----------
add more special variables/constants
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/rubyeditor/RubyEditorPreferences.properties
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/rubyeditor/RubyEditorPreferences.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/rubyeditor/RubyEditorPreferences.properties 2007-01-25 14:19:04 UTC (rev 1879)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/rubyeditor/RubyEditorPreferences.properties 2007-01-25 14:22:26 UTC (rev 1880)
@@ -1 +1 @@
-keywords=BEGIN,END,alias,and,begin,break,case,class,def,defined?,do,each,else,elsif,end,ensure,false,for,if,in,module,new,next,nil,not,or,raise,redo,rescue,retry,return,self,super,then,throw,true,undef,unless,until,when,while,yield
\ No newline at end of file
+keywords=__FILE__,__LINE__,ARGF,ARGV,BEGIN,DATA,END,ENV,RUBY_PLATFORM,RUBY_RELEASE_DATE,RUBY_VERSION,alias,and,begin,break,case,class,def,defined?,do,each,else,elsif,end,ensure,false,for,if,in,module,new,next,nil,not,or,raise,redo,rescue,retry,return,self,super,then,throw,true,undef,unless,until,when,while,yield
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-25 14:19:06
|
Revision: 1879
http://svn.sourceforge.net/rubyeclipse/?rev=1879&view=rev
Author: cawilliams
Date: 2007-01-25 06:19:04 -0800 (Thu, 25 Jan 2007)
Log Message:
-----------
modify detctection of default libraries. Now we execute a script which spits our the ruby version and loadpaths for us, then we parse them to get our LibraryInfo. Removed extension and endorsed directories from library/vm stuff since that sort of thing doesn't make sense for ruby
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LibraryInfo.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/ruby/loadpath.rb
Added: trunk/org.rubypeople.rdt.launching/ruby/loadpath.rb
===================================================================
--- trunk/org.rubypeople.rdt.launching/ruby/loadpath.rb (rev 0)
+++ trunk/org.rubypeople.rdt.launching/ruby/loadpath.rb 2007-01-25 14:19:04 UTC (rev 1879)
@@ -0,0 +1,2 @@
+puts RUBY_VERSION
+puts $LOAD_PATH - ['.']
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java 2007-01-25 14:18:01 UTC (rev 1878)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java 2007-01-25 14:19:04 UTC (rev 1879)
@@ -7,6 +7,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URL;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
@@ -29,6 +30,7 @@
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IPath;
@@ -456,8 +458,6 @@
Element libraryElement = doc.createElement("libraryInfo"); //$NON-NLS-1$
libraryElement.setAttribute("version", info.getVersion()); //$NON-NLS-1$
appendPathElements(doc, "bootpath", libraryElement, info.getBootpath()); //$NON-NLS-1$
- appendPathElements(doc, "extensionDirs", libraryElement, info.getExtensionDirs()); //$NON-NLS-1$
- appendPathElements(doc, "endorsedDirs", libraryElement, info.getEndorsedDirs()); //$NON-NLS-1$
return libraryElement;
}
@@ -527,10 +527,8 @@
String version = element.getAttribute("version"); //$NON-NLS-1$
String location = element.getAttribute("home"); //$NON-NLS-1$
String[] bootpath = getPathsFromXML(element, "bootpath"); //$NON-NLS-1$
- String[] extDirs = getPathsFromXML(element, "extensionDirs"); //$NON-NLS-1$
- String[] endDirs = getPathsFromXML(element, "endorsedDirs"); //$NON-NLS-1$
if (location != null) {
- LibraryInfo info = new LibraryInfo(version, bootpath, extDirs, endDirs);
+ LibraryInfo info = new LibraryInfo(version, bootpath);
fgLibraryInfoMap.put(location, info);
}
}
@@ -819,4 +817,19 @@
}
}
+
+ /**
+ * Return a <code>java.io.File</code> object that corresponds to the specified
+ * <code>IPath</code> in the plugin directory.
+ */
+ public static File getFileInPlugin(IPath path) {
+ try {
+ URL installURL =
+ new URL(getDefault().getBundle().getEntry("/"), path.toString()); //$NON-NLS-1$
+ URL localURL = FileLocator.toFileURL(installURL);
+ return new File(localURL.getFile());
+ } catch (IOException ioe) {
+ return null;
+ }
+ }
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LibraryInfo.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LibraryInfo.java 2007-01-25 14:18:01 UTC (rev 1878)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LibraryInfo.java 2007-01-25 14:19:04 UTC (rev 1879)
@@ -18,14 +18,10 @@
private String fVersion;
private String[] fBootpath;
- private String[] fExtensionDirs;
- private String[] fEndorsedDirs;
- public LibraryInfo(String version, String[] bootpath, String[] extDirs, String[] endDirs) {
+ public LibraryInfo(String version, String[] bootpath) {
fVersion = version;
fBootpath = bootpath;
- fExtensionDirs = extDirs;
- fEndorsedDirs = endDirs;
}
/**
@@ -36,17 +32,8 @@
public String getVersion() {
return fVersion;
}
-
+
/**
- * Returns a collection of extension directory paths for this VM install.
- *
- * @return a collection of absolute paths
- */
- public String[] getExtensionDirs() {
- return fExtensionDirs;
- }
-
- /**
* Returns a collection of bootpath entries for this VM install.
*
* @return a collection of absolute paths
@@ -54,13 +41,4 @@
public String[] getBootpath() {
return fBootpath;
}
-
- /**
- * Returns a collection of endorsed directory paths for this VM install.
- *
- * @return a collection of absolute paths
- */
- public String[] getEndorsedDirs() {
- return fEndorsedDirs;
- }
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java 2007-01-25 14:18:01 UTC (rev 1878)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java 2007-01-25 14:19:04 UTC (rev 1879)
@@ -13,9 +13,7 @@
import java.io.File;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -94,20 +92,13 @@
if (libraryInfo != null) {
// only return endorsed and bootstrap classpath entries if we have the info
// libs in the ext dirs are not loaded by the boot class loader
- String[] extensionDirsArray = libraryInfo.getExtensionDirs();
- Set extensionDirsSet = new HashSet();
- for (int i = 0; i < extensionDirsArray.length; i++) {
- extensionDirsSet.add(extensionDirsArray[i]);
- }
+
List resolvedEntries = new ArrayList(libs.length);
for (int i = 0; i < libs.length; i++) {
IPath location = libs[i];
IPath libraryPath = location;
String dir = libraryPath.toFile().getParent();
- // exclude extension directory entries
- if (!extensionDirsSet.contains(dir)) {
- resolvedEntries.add(resolveLibraryLocation(vm, location, kind, overrideRubydoc));
- }
+ resolvedEntries.add(resolveLibraryLocation(vm, location, kind, overrideRubydoc));
}
return (IRuntimeLoadpathEntry[]) resolvedEntries.toArray(new IRuntimeLoadpathEntry[resolvedEntries.size()]);
}
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-01-25 14:18:01 UTC (rev 1878)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-01-25 14:19:04 UTC (rev 1879)
@@ -1,13 +1,24 @@
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.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.rubypeople.rdt.launching.AbstractVMInstallType;
import org.rubypeople.rdt.launching.IVMInstall;
@@ -37,12 +48,19 @@
return new StandardVM(this, id);
}
- public IPath[] getDefaultLibraryLocations(File installLocation) {
- String stdPath = installLocation.getAbsolutePath() + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "1.8";
- String sitePath = installLocation.getAbsolutePath() + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "site_ruby" + fgSeparator + "1.8";
- IPath[] paths = new IPath[2];
- paths[0] = new Path(stdPath);
- paths[1] = new Path(sitePath);
+ public IPath[] getDefaultLibraryLocations(File installLocation) {
+ File rubyExecutable = findRubyExecutable(installLocation);
+ LibraryInfo 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]);
+ }
+// String stdPath = installLocation.getAbsolutePath() + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "1.8";
+// String sitePath = installLocation.getAbsolutePath() + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "site_ruby" + fgSeparator + "1.8";
+// IPath[] paths = new IPath[2];
+// paths[0] = new Path(stdPath);
+// paths[1] = new Path(sitePath);
return paths;
}
@@ -103,8 +121,7 @@
* location. If the info does not exist, create it using the given Java
* executable.
*/
- protected synchronized LibraryInfo getLibraryInfo(File rubyHome, File rubyExecutable) {
-
+ 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);
@@ -124,9 +141,70 @@
return info;
}
- private LibraryInfo generateLibraryInfo(
- File javaHome, File javaExecutable) {
- // TODO Auto-generated method stub
+ 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/loadpath.rb")); //$NON-NLS-1$
+ if (file.exists()) {
+ String javaExecutablePath = rubyExecutable.getAbsolutePath();
+ String[] cmdLine = new String[] {javaExecutablePath, 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}", new String[]{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) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (lines.size() > 0) {
+ String version = lines.remove(0);
+ if (lines.size() > 0) {
+ String[] loadpath = (String[]) lines.toArray(new String[lines.size()]);
+ return new LibraryInfo(version, loadpath);
+ }
+ }
return null;
}
@@ -138,21 +216,7 @@
*/
protected LibraryInfo getDefaultLibraryInfo(File installLocation) {
IPath rtjar = getDefaultSystemLibrary(installLocation);
- File extDir = null;
- File endDir = null;
- String[] dirs = null;
- if (extDir == null) {
- dirs = new String[0];
- } else {
- dirs = new String[] {extDir.getAbsolutePath()};
- }
- String[] endDirs = null;
- if (endDir == null) {
- endDirs = new String[0];
- } else {
- endDirs = new String[] {endDir.getAbsolutePath()};
- }
- return new LibraryInfo("1.8.4", new String[] {rtjar.toOSString()}, dirs, endDirs); //$NON-NLS-1$
+ return new LibraryInfo("1.8.4", new String[] {rtjar.toOSString()}); //$NON-NLS-1$
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-25 14:18:02
|
Revision: 1878
http://svn.sourceforge.net/rubyeclipse/?rev=1878&view=rev
Author: cawilliams
Date: 2007-01-25 06:18:01 -0800 (Thu, 25 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstall.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstall.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstall.java 2007-01-24 23:39:11 UTC (rev 1877)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstall.java 2007-01-25 14:18:01 UTC (rev 1878)
@@ -133,7 +133,7 @@
}
/* (non-Javadoc)
- * @see org.eclipse.jdt.launching.IVMInstall#setLibraryLocations(org.eclipse.jdt.launching.LibraryLocation[])
+ * @see org.rubypeople.rdt.launching.IVMInstall#setLibraryLocations(org.eclipse.core.runtime.IPath[])
*/
public void setLibraryLocations(IPath[] locations) {
if (locations == fSystemLibraryDescriptions) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-24 23:39:59
|
Revision: 1877
http://svn.sourceforge.net/rubyeclipse/?rev=1877&view=rev
Author: cawilliams
Date: 2007-01-24 15:39:11 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/VMRunnerConfiguration.java
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-01-24 21:50:11 UTC (rev 1876)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-01-24 23:39:11 UTC (rev 1877)
@@ -62,11 +62,8 @@
subMonitor.subTask(LaunchingMessages.StandardVMDebugger_Constructing_command_line____3);
RubyDebugTarget debugTarget = new RubyDebugTarget(launch, port);
-
String program = constructProgramString(config);
-
List<String> arguments = new ArrayList<String>(12);
-
arguments.add(program);
// VM args are the first thing after the ruby program so that users can
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/VMRunnerConfiguration.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/VMRunnerConfiguration.java 2007-01-24 21:50:11 UTC (rev 1876)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/VMRunnerConfiguration.java 2007-01-24 23:39:11 UTC (rev 1877)
@@ -97,13 +97,13 @@
}
/**
- * Sets the environment for the Java program. The Java VM will be
+ * Sets the environment for the Ruby program. The Ruby VM will be
* launched in the given environment.
*
- * @param environment the environment for the Java program specified as an array
+ * @param environment the environment for the Ruby program specified as an array
* of strings, each element specifying an environment variable setting in the
* format <i>name</i>=<i>value</i>
- * @since 3.0
+ * @since 0.9.0
*/
public void setEnvironment(String[] environment) {
fEnvironment= environment;
@@ -165,10 +165,10 @@
}
/**
- * Returns the environment for the Java program or <code>null</code>
+ * Returns the environment for the Ruby program or <code>null</code>
*
- * @return The Java program environment. Default is <code>null</code>
- * @since 3.0
+ * @return The Ruby program environment. Default is <code>null</code>
+ * @since 0.9.0
*/
public String[] getEnvironment() {
return fEnvironment;
@@ -181,7 +181,7 @@
* to be used by a launched VM, or <code>null</code> if
* the default working directory is to be inherited from the
* current process
- * @since 2.0
+ * @since 0.9.0
*/
public void setWorkingDirectory(String path) {
fWorkingDirectory = path;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-24 22:06:16
|
Revision: 1876
http://svn.sourceforge.net/rubyeclipse/?rev=1876&view=rev
Author: cawilliams
Date: 2007-01-24 13:50:11 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
fix a broken test
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/ModifyingResourceTest.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/util/Util.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java 2007-01-24 15:54:40 UTC (rev 1875)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java 2007-01-24 21:50:11 UTC (rev 1876)
@@ -267,7 +267,7 @@
protected IRubyProject createRubyProject(String projectName) throws CoreException {
- return this.createRubyProject(projectName, new String[] {""}, new String[] {"JCL_LIB"});
+ return this.createRubyProject(projectName, new String[] {""}, new String[] {"RUBY_LIB"});
}
/*
@@ -675,4 +675,20 @@
// TODO Find some way to wait until the indexes are ready from SymbolIndex/build process
}
+
+ public void deleteFile(File file) {
+ int retryCount = 0;
+ while (++retryCount <= 60) { // wait 1 minute at most
+ if (org.rubypeople.rdt.core.tests.util.Util.delete(file)) {
+ break;
+ }
+ }
+ }
+ protected void deleteFolder(IPath folderPath) throws CoreException {
+ deleteResource(getFolder(folderPath));
+ }
+
+ protected IFolder getFolder(IPath path) {
+ return getWorkspaceRoot().getFolder(path);
+ }
}
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/ModifyingResourceTest.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/ModifyingResourceTest.java 2007-01-24 15:54:40 UTC (rev 1875)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/ModifyingResourceTest.java 2007-01-24 21:50:11 UTC (rev 1876)
@@ -45,4 +45,11 @@
}
return file;
}
+
+ protected void deleteFile(String filePath) throws CoreException {
+ deleteResource(this.getFile(filePath));
+ }
+ protected void deleteFolder(String folderPath) throws CoreException {
+ deleteFolder(new Path(folderPath));
+ }
}
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/util/Util.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/util/Util.java 2007-01-24 15:54:40 UTC (rev 1875)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/util/Util.java 2007-01-24 21:50:11 UTC (rev 1876)
@@ -429,4 +429,109 @@
buffer.append("\"");
return buffer.toString();
}
+
+ /**
+ * Delete a file or directory and insure that the file is no longer present
+ * on file system. In case of directory, delete all the hierarchy underneath.
+ *
+ * @param file The file or directory to delete
+ * @return true iff the file was really delete, false otherwise
+ */
+ public static boolean delete(File file) {
+ // flush all directory content
+ if (file.isDirectory()) {
+ flushDirectoryContent(file);
+ }
+ // remove file
+ file.delete();
+ if (isFileDeleted(file)) {
+ return true;
+ }
+ return waitUntilFileDeleted(file);
+ }
+
+ /**
+ * Flush content of a given directory (leaving it empty),
+ * no-op if not a directory.
+ */
+ public static void flushDirectoryContent(File dir) {
+ File[] files = dir.listFiles();
+ if (files == null) return;
+ for (int i = 0, max = files.length; i < max; i++) {
+ delete(files[i]);
+ }
+ }
+
+ /**
+ * Wait until the file is _really_ deleted on file system.
+ *
+ * @param file Deleted file
+ * @return true if the file was finally deleted, false otherwise
+ */
+ private static boolean waitUntilFileDeleted(File file) {
+ if (DELETE_DEBUG) {
+ System.out.println();
+ System.out.println("WARNING in test: "+getTestName());
+ System.out.println(" - problems occured while deleting "+file);
+ printRdtCoreStackTrace(null, 1);
+ printFileInfo(file.getParentFile(), 1, -1); // display parent with its children
+ System.out.print(" - wait for ("+DELETE_MAX_WAIT+"ms max): ");
+ }
+ int count = 0;
+ int delay = 10; // ms
+ int maxRetry = DELETE_MAX_WAIT / delay;
+ int time = 0;
+ while (count < maxRetry) {
+ try {
+ count++;
+ Thread.sleep(delay);
+ time += delay;
+ if (time > DELETE_MAX_TIME) DELETE_MAX_TIME = time;
+ if (DELETE_DEBUG) System.out.print('.');
+ if (file.exists()) {
+ if (file.delete()) {
+ // SUCCESS
+ if (DELETE_DEBUG) {
+ System.out.println();
+ System.out.println(" => file really removed after "+time+"ms (max="+DELETE_MAX_TIME+"ms)");
+ System.out.println();
+ }
+ return true;
+ }
+ }
+ if (isFileDeleted(file)) {
+ // SUCCESS
+ if (DELETE_DEBUG) {
+ System.out.println();
+ System.out.println(" => file disappeared after "+time+"ms (max="+DELETE_MAX_TIME+"ms)");
+ System.out.println();
+ }
+ return true;
+ }
+ // Increment waiting delay exponentially
+ if (count >= 10 && delay <= 100) {
+ count = 1;
+ delay *= 10;
+ maxRetry = DELETE_MAX_WAIT / delay;
+ if ((DELETE_MAX_WAIT%delay) != 0) {
+ maxRetry++;
+ }
+ }
+ }
+ catch (InterruptedException ie) {
+ break; // end loop
+ }
+ }
+ if (!DELETE_DEBUG) {
+ System.out.println();
+ System.out.println("WARNING in test: "+getTestName());
+ System.out.println(" - problems occured while deleting "+file);
+ printRdtCoreStackTrace(null, 1);
+ printFileInfo(file.getParentFile(), 1, -1); // display parent with its children
+ }
+ System.out.println();
+ System.out.println(" !!! ERROR: "+file+" was never deleted even after having waited "+DELETE_MAX_TIME+"ms!!!");
+ System.out.println();
+ return false;
+ }
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-01-24 15:54:40 UTC (rev 1875)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-01-24 21:50:11 UTC (rev 1876)
@@ -83,11 +83,6 @@
private String fDefaultVMInstallCompositeID;
/**
- * The identifier of the connector to use for the default VM.
- */
- private String fDefaultVMInstallConnectorTypeID;
-
- /**
* Constructs an empty VM container
*/
public VMDefinitionsContainer() {
@@ -202,24 +197,6 @@
}
/**
- * Return the default VM's connector type ID.
- *
- * @return String the current value of the default VM's connector type ID
- */
- public String getDefaultVMInstallConnectorTypeID() {
- return fDefaultVMInstallConnectorTypeID;
- }
-
- /**
- * Set the default VM's connector type ID.
- *
- * @param id the new value of the default VM's connector type ID
- */
- public void setDefaultVMInstallConnectorTypeID(String id){
- fDefaultVMInstallConnectorTypeID = id;
- }
-
- /**
* Return the VM definitions contained in this object as a String of XML. The String
* is suitable for storing in the workbench preferences.
* <p>
@@ -243,12 +220,7 @@
if (getDefaultVMInstallCompositeID() != null) {
config.setAttribute("defaultVM", getDefaultVMInstallCompositeID()); //$NON-NLS-1$
}
-
- // Set the defaultVMConnector attribute on the top-level node
- if (getDefaultVMInstallConnectorTypeID() != null) {
- config.setAttribute("defaultVMConnector", getDefaultVMInstallConnectorTypeID()); //$NON-NLS-1$
- }
-
+
// Create a node for each install type represented in this container
Set vmInstallTypeSet = getVMTypeToVMMap().keySet();
Iterator keyIterator = vmInstallTypeSet.iterator();
@@ -398,7 +370,6 @@
// Populate the default VM-related fields
container.setDefaultVMInstallCompositeID(config.getAttribute("defaultVM")); //$NON-NLS-1$
- container.setDefaultVMInstallConnectorTypeID(config.getAttribute("defaultVMConnector")); //$NON-NLS-1$
// Traverse the parsed structure and populate the VMType to VM Map
NodeList list = config.getChildNodes();
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-01-24 15:54:40 UTC (rev 1875)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-24 21:50:11 UTC (rev 1876)
@@ -123,7 +123,6 @@
private static boolean fgInitializingVMs;
private static String fgDefaultVMId;
private static ListenerList fgVMListeners = new ListenerList(5);
- private static String fgDefaultVMConnectorId;
/**
* Cache of already resolved projects in container entries. Used to avoid
@@ -250,8 +249,7 @@
private static String getVMsAsXML() throws IOException, ParserConfigurationException, TransformerException {
VMDefinitionsContainer container = new VMDefinitionsContainer();
- container.setDefaultVMInstallCompositeID(getDefaultVMId());
- container.setDefaultVMInstallConnectorTypeID(getDefaultVMConnectorId());
+ container.setDefaultVMInstallCompositeID(getDefaultVMId());
IVMInstallType[] vmTypes= getVMInstallTypes();
for (int i = 0; i < vmTypes.length; ++i) {
IVMInstall[] vms = vmTypes[i].getVMInstalls();
@@ -263,11 +261,6 @@
return container.getAsXML();
}
- private static String getDefaultVMConnectorId() {
- initializeVMs();
- return fgDefaultVMConnectorId;
- }
-
/**
* Saves the preferences for the launching plug-in.
*
@@ -362,7 +355,6 @@
}
}
fgDefaultVMId = vmDefs.getDefaultVMInstallCompositeID();
- fgDefaultVMConnectorId = vmDefs.getDefaultVMInstallConnectorTypeID();
// Create the underlying VMs for each valid VM
List vmList = vmDefs.getValidVMList();
Modified: trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-01-24 15:54:40 UTC (rev 1875)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-01-24 21:50:11 UTC (rev 1876)
@@ -2,20 +2,22 @@
import java.io.File;
-import junit.framework.TestCase;
-
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.CoreException;
+import org.rubypeople.rdt.core.tests.ModifyingResourceTest;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMInstallType;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.launching.VMStandin;
-public class TC_RubyRuntime extends TestCase {
+public class TC_RubyRuntime extends ModifyingResourceTest {
private static final String VM_TYPE_ID = "org.rubypeople.rdt.launching.StandardVMType";
private IVMInstallType vmType;
-
+ private IFolder folderOne;
+ private IFolder folderTwo;
+
public TC_RubyRuntime(String name) {
super(name);
}
@@ -24,13 +26,26 @@
protected void setUp() throws Exception {
super.setUp();
vmType = RubyRuntime.getVMInstallType(VM_TYPE_ID);
+ RubyRuntime.setDefaultVMInstall(null, null, true);
+ LaunchingPlugin.getDefault().setIgnoreVMDefPropertyChangeEvents(true);
+ createProject("/rubyRuntime");
+ folderOne = createFolder("/rubyRuntime/interpreterOne");
+ createFolder("/rubyRuntime/interpreterOne/lib");
+ createFolder("/rubyRuntime/interpreterOne/bin");
+ createFile("/rubyRuntime/interpreterOne/bin/ruby", "");
+ folderTwo = createFolder("/rubyRuntime/interpreterTwo");
+ createFolder("/rubyRuntime/interpreterTwo/lib");
+ createFolder("/rubyRuntime/interpreterTwo/bin");
+ createFile("/rubyRuntime/interpreterTwo/bin/ruby", "");
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
-// RubyRuntime.setDefaultVMInstall(null, true);
+ vmType = null;
+ RubyRuntime.setDefaultVMInstall(null, null, true);
RubyRuntime.getPreferences().setValue(RubyRuntime.PREF_VM_XML, "");
+ deleteProject("/rubyRuntime");
}
public void testGetInstalledInterpreters() {
@@ -59,29 +74,29 @@
public void testSetInstalledInterpreters() throws CoreException {
try {
VMStandin standin = new VMStandin(vmType, "InterpreterOne");
- standin.setInstallLocation(new File("C:\\RubyInstallRootOne"));
+ standin.setInstallLocation(folderOne.getLocation().toFile());
standin.setName("InterpreterOne");
- standin.convertToRealVM();
- RubyRuntime.saveVMConfiguration();
+ IVMInstall one = standin.convertToRealVM();
+ RubyRuntime.setDefaultVMInstall(one, null,true);
assertEquals(
"XML should indicate only one interpreter with it being the selected.",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<vmSettings defaultVM=\"\" defaultVMConnector=\"\">\r\n<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n<vm id=\"InterpreterOne\" name=\"InterpreterOne\" path=\"C:\\RubyInstallRootOne\"/>\r\n</vmType>\r\n</vmSettings>\r\n",
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<vmSettings defaultVM=\"43,org.rubypeople.rdt.launching.StandardVMType14,InterpreterOne\">\r\n<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n<vm id=\"InterpreterOne\" name=\"InterpreterOne\" path=\"" + folderOne.getLocation().toOSString() + "\"/>\r\n</vmType>\r\n</vmSettings>\r\n",
getVMsXML());
VMStandin standin2 = new VMStandin(vmType, "InterpreterTwo");
- standin2.setInstallLocation(new File("C:\\RubyInstallRootTwo"));
+ standin2.setInstallLocation(folderTwo.getLocation().toFile());
standin2.setName("InterpreterTwo");
- standin2.convertToRealVM();
+ IVMInstall two = standin2.convertToRealVM();
RubyRuntime.saveVMConfiguration();
assertEquals(
"XML should indicate both interpreters with the first one being selected.",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<vmSettings defaultVM=\"\" defaultVMConnector=\"\">\r\n<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n<vm id=\"InterpreterOne\" name=\"InterpreterOne\" path=\"C:\\RubyInstallRootOne\"/>\r\n<vm id=\"InterpreterTwo\" name=\"InterpreterTwo\" path=\"C:\\RubyInstallRootTwo\"/>\r\n</vmType>\r\n</vmSettings>\r\n",
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<vmSettings defaultVM=\"43,org.rubypeople.rdt.launching.StandardVMType14,InterpreterOne\">\r\n<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n<vm id=\"InterpreterOne\" name=\"InterpreterOne\" path=\"" + folderOne.getLocation().toOSString() + "\"/>\r\n<vm id=\"InterpreterTwo\" name=\"InterpreterTwo\" path=\"" + folderTwo.getLocation().toOSString() + "\"/>\r\n</vmType>\r\n</vmSettings>\r\n",
getVMsXML());
- RubyRuntime.setDefaultVMInstall(standin2, null,true);
+ RubyRuntime.setDefaultVMInstall(two, null,true);
assertEquals(
"XML should indicate both interpreters with the first one being selected.",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<vmSettings defaultVM=\"" + RubyRuntime.getCompositeIdFromVM(standin2) + "\" defaultVMConnector=\"\">\r\n<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n<vm id=\"InterpreterOne\" name=\"InterpreterOne\" path=\"C:\\RubyInstallRootOne\"/>\r\n<vm id=\"InterpreterTwo\" name=\"InterpreterTwo\" path=\"C:\\RubyInstallRootTwo\"/>\r\n</vmType>\r\n</vmSettings>\r\n",
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<vmSettings defaultVM=\"" + RubyRuntime.getCompositeIdFromVM(standin2) + "\">\r\n<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n<vm id=\"InterpreterOne\" name=\"InterpreterOne\" path=\"" + folderOne.getLocation().toOSString() + "\"/>\r\n<vm id=\"InterpreterTwo\" name=\"InterpreterTwo\" path=\"" + folderTwo.getLocation().toOSString() + "\"/>\r\n</vmType>\r\n</vmSettings>\r\n",
getVMsXML());
} finally {
vmType.disposeVMInstall("InterpreterOne");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1875
http://svn.sourceforge.net/rubyeclipse/?rev=1875&view=rev
Author: cawilliams
Date: 2007-01-24 07:54:40 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java
Modified: trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java 2007-01-24 15:38:21 UTC (rev 1874)
+++ trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java 2007-01-24 15:54:40 UTC (rev 1875)
@@ -1,6 +1,8 @@
package org.rubypeople.rdt.internal.debug.ui.launcher;
import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
import junit.framework.Assert;
@@ -22,6 +24,7 @@
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
import org.rubypeople.rdt.internal.debug.ui.RubySourceLocator;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMInstallType;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.launching.VMStandin;
@@ -36,7 +39,8 @@
protected ShamRubyApplicationShortcut shortcut;
protected IFile rubyFile, nonRubyFile;
private static String SHAM_LAUNCH_CONFIG_TYPE = "org.rubypeople.rdt.debug.ui.tests.launching.LaunchConfigurationTypeSham";
-
+ private Set configurations = new HashSet();
+
public TC_RubyApplicationShortcut(String name) {
super(name);
}
@@ -59,8 +63,7 @@
}
protected ILaunchConfiguration[] getLaunchConfigurations() throws CoreException {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- return launchManager.getLaunchConfigurations(launchManager.getLaunchConfigurationType(SHAM_LAUNCH_CONFIG_TYPE));
+ return (ILaunchConfiguration[]) configurations.toArray(new ILaunchConfiguration[configurations.size()]);
}
private IVMInstallType vmType;
@@ -86,7 +89,8 @@
VMStandin standin = new VMStandin(vmType, VM_ID);
standin.setInstallLocation(new File("C:/RubyInstallRootOne"));
standin.setName("InterpreterOne");
- standin.convertToRealVM();
+ IVMInstall vm = standin.convertToRealVM();
+ RubyRuntime.setDefaultVMInstall(vm, null, true);
super.setUp();
}
@@ -94,6 +98,7 @@
protected void tearDown() throws Exception {
super.tearDown();
deleteProject("project1");
+ configurations.clear();
}
@@ -243,6 +248,7 @@
protected void doLaunch(IRubyElement rubyElement, String mode) throws CoreException {
ILaunchConfiguration config = findOrCreateLaunchConfiguration(rubyElement, mode);
if (config != null) {
+ configurations.add(config);
launches++;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-24 15:38:28
|
Revision: 1874
http://svn.sourceforge.net/rubyeclipse/?rev=1874&view=rev
Author: cawilliams
Date: 2007-01-24 07:38:21 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching.tests/plugin.xml
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
Modified: trunk/org.rubypeople.rdt.launching.tests/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/plugin.xml 2007-01-24 15:31:18 UTC (rev 1873)
+++ trunk/org.rubypeople.rdt.launching.tests/plugin.xml 2007-01-24 15:38:21 UTC (rev 1874)
@@ -20,6 +20,7 @@
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.rubypeople.eclipse.testutils"/>
<import plugin="org.rubypeople.rdt.core"/>
+ <import plugin="org.rubypeople.rdt.core.tests"/>
</requires>
</plugin>
Modified: trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-01-24 15:31:18 UTC (rev 1873)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-01-24 15:38:21 UTC (rev 1874)
@@ -6,8 +6,6 @@
import java.util.List;
import java.util.Map;
-import junit.framework.TestCase;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -22,14 +20,15 @@
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.Launch;
import org.rubypeople.eclipse.shams.debug.core.ShamLaunchConfigurationType;
-import org.rubypeople.eclipse.testutils.ResourceTools;
+import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.RubyCore;
+import org.rubypeople.rdt.core.tests.ModifyingResourceTest;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMInstallType;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.launching.VMStandin;
-public class TC_RunnerLaunching extends TestCase {
+public class TC_RunnerLaunching extends ModifyingResourceTest {
private final static String PROJECT_NAME = "Simple Project";
private final static String RUBY_LIB_DIR = "someRubyDir"; // dir inside project
@@ -40,6 +39,7 @@
private static final String VM_TYPE_ID = "org.rubypeople.rdt.launching.StandardVMType";
private IVMInstallType vmType;
+ private IRubyProject project;
public TC_RunnerLaunching(String name) {
super(name);
@@ -54,8 +54,15 @@
standin.setInstallLocation(new File("C:\ruby"));
IVMInstall real = standin.convertToRealVM();
RubyRuntime.setDefaultVMInstall(real, null, true);
+ project = createRubyProject(PROJECT_NAME);
}
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ deleteProject(PROJECT_NAME);
+ }
+
protected ILaunchManager getLaunchManager() {
return DebugPlugin.getDefault().getLaunchManager();
}
@@ -102,11 +109,8 @@
}
public void launch(boolean debug) throws Exception {
+ IVMInstall interpreter = new VMStandin(vmType, "");
- IProject project = ResourceTools.createProject(PROJECT_NAME);
-
- IVMInstall interpreter = new VMStandin((IVMInstallType)null, "");
-
ILaunchConfiguration configuration = new ShamLaunchConfiguration();
ILaunch launch = new Launch(configuration, debug ? ILaunchManager.DEBUG_MODE : ILaunchManager.RUN_MODE, null);
ILaunchConfigurationType launchConfigurationType =
@@ -119,7 +123,7 @@
null);
assertEquals("One process has been spawned", 1, launch.getProcesses().length);
- List expected = getCommandLine(project, debug);
+ List expected = getCommandLine(project.getProject(), debug);
String[] actual = interpreter.getVMArguments();
if (debug) {
// we must cheat with the first argument, because it is a temporary file which
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-24 15:31:22
|
Revision: 1873
http://svn.sourceforge.net/rubyeclipse/?rev=1873&view=rev
Author: cawilliams
Date: 2007-01-24 07:31:18 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
fix broken test
Modified Paths:
--------------
trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamFile.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java
Modified: trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamFile.java
===================================================================
--- trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamFile.java 2007-01-24 14:50:49 UTC (rev 1872)
+++ trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamFile.java 2007-01-24 15:31:18 UTC (rev 1873)
@@ -7,6 +7,7 @@
import java.io.InputStream;
import java.io.Reader;
import java.net.URI;
+import java.nio.charset.Charset;
import junit.framework.Assert;
@@ -48,7 +49,7 @@
}
public String getCharset() throws CoreException {
- return null;
+ return Charset.defaultCharset().name();
}
public ShamFile(String fullPath, boolean readContentFromFile) {
@@ -312,8 +313,7 @@
* @see org.eclipse.core.resources.IFile#getCharset(boolean)
*/
public String getCharset(boolean checkImplicit) throws CoreException {
- // TODO Auto-generated method stub
- return null;
+ return getCharset();
}
/* (non-Javadoc)
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java 2007-01-24 14:50:49 UTC (rev 1872)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java 2007-01-24 15:31:18 UTC (rev 1873)
@@ -15,6 +15,7 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
+import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import org.eclipse.core.resources.IFile;
@@ -52,14 +53,14 @@
String contents = readContents(reader);
markerManager.removeProblemsAndTasksFor(file);
try {
- Node rootNode = parser.parse(file, reader);
+ Node rootNode = parser.parse(file, new StringReader(contents));
if (rootNode == null) return;
RubyLintVisitor visitor = new RubyLintVisitor(contents, new ProblemRequestorMarkerManager(file, markerManager));
rootNode.accept(visitor);
indexUpdater.update(file, rootNode, true);
} catch (SyntaxException e) {
// Should we really put a marker here? I think the normal parsing process will create syntax markers just fine
- //markerManager.createSyntaxError(file, e);
+ markerManager.createSyntaxError(file, e);
} finally {
IoUtils.closeQuietly(reader);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|