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-06-20 20:48:01
|
Revision: 2647
http://svn.sourceforge.net/rubyeclipse/?rev=2647&view=rev
Author: cawilliams
Date: 2007-06-20 13:47:59 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
remove unused imports
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/AddSelectedSourceFolderOperation.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/ExcludeOperation.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/ResetAllOperation.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/UnexcludeOperation.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/AssistContext.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/BuildPathSupport.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/FolderSelectionDialog.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/LoadpathContainerSelectionPage.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/FindReferencesAction.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/AddSelectedSourceFolderOperation.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/AddSelectedSourceFolderOperation.java 2007-06-20 20:19:28 UTC (rev 2646)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/AddSelectedSourceFolderOperation.java 2007-06-20 20:47:59 UTC (rev 2647)
@@ -30,7 +30,6 @@
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.RubyModelException;
-import org.rubypeople.rdt.internal.corext.buildpath.LoadpathModifier.ILoadpathModifierListener;
import org.rubypeople.rdt.internal.corext.util.Messages;
import org.rubypeople.rdt.internal.ui.wizards.NewWizardMessages;
import org.rubypeople.rdt.internal.ui.wizards.buildpaths.newsourcepage.DialogPackageExplorerActionGroup;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/ExcludeOperation.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/ExcludeOperation.java 2007-06-20 20:19:28 UTC (rev 2646)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/ExcludeOperation.java 2007-06-20 20:47:59 UTC (rev 2647)
@@ -30,7 +30,6 @@
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.RubyModelException;
-import org.rubypeople.rdt.internal.corext.buildpath.LoadpathModifier.ILoadpathModifierListener;
import org.rubypeople.rdt.internal.corext.util.Messages;
import org.rubypeople.rdt.internal.ui.wizards.NewWizardMessages;
import org.rubypeople.rdt.internal.ui.wizards.buildpaths.newsourcepage.DialogPackageExplorerActionGroup;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/ResetAllOperation.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/ResetAllOperation.java 2007-06-20 20:19:28 UTC (rev 2646)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/ResetAllOperation.java 2007-06-20 20:47:59 UTC (rev 2647)
@@ -25,12 +25,10 @@
import java.util.List;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.rubypeople.rdt.core.ILoadpathEntry;
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.RubyModelException;
-import org.rubypeople.rdt.internal.corext.buildpath.LoadpathModifier.ILoadpathModifierListener;
import org.rubypeople.rdt.internal.ui.wizards.NewWizardMessages;
import org.rubypeople.rdt.internal.ui.wizards.buildpaths.newsourcepage.LoadpathModifierOperation;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/UnexcludeOperation.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/UnexcludeOperation.java 2007-06-20 20:19:28 UTC (rev 2646)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/buildpath/UnexcludeOperation.java 2007-06-20 20:47:59 UTC (rev 2647)
@@ -30,7 +30,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.RubyModelException;
-import org.rubypeople.rdt.internal.corext.buildpath.LoadpathModifier.ILoadpathModifierListener;
import org.rubypeople.rdt.internal.corext.util.Messages;
import org.rubypeople.rdt.internal.ui.wizards.NewWizardMessages;
import org.rubypeople.rdt.internal.ui.wizards.buildpaths.newsourcepage.DialogPackageExplorerActionGroup;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java 2007-06-20 20:19:28 UTC (rev 2646)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java 2007-06-20 20:47:59 UTC (rev 2647)
@@ -130,7 +130,6 @@
import org.rubypeople.rdt.ui.actions.FormatAction;
import org.rubypeople.rdt.ui.actions.IRubyEditorActionDefinitionIds;
import org.rubypeople.rdt.ui.actions.OpenEditorActionGroup;
-import org.rubypeople.rdt.ui.actions.RubyActionGroup;
import org.rubypeople.rdt.ui.actions.RubySearchActionGroup;
import org.rubypeople.rdt.ui.actions.SurroundWithBeginRescueAction;
import org.rubypeople.rdt.ui.text.folding.IRubyFoldingStructureProvider;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/AssistContext.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/AssistContext.java 2007-06-20 20:19:28 UTC (rev 2646)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/AssistContext.java 2007-06-20 20:47:59 UTC (rev 2647)
@@ -15,7 +15,6 @@
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
-import org.rubypeople.rdt.internal.core.util.DOMFinder;
import org.rubypeople.rdt.internal.ti.util.OffsetNodeLocator;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.ui.text.ruby.IInvocationContext;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/BuildPathSupport.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/BuildPathSupport.java 2007-06-20 20:19:28 UTC (rev 2646)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/BuildPathSupport.java 2007-06-20 20:47:59 UTC (rev 2647)
@@ -22,7 +22,6 @@
import java.util.ArrayList;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -30,15 +29,12 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
-import org.rubypeople.rdt.core.ILoadpathAttribute;
import org.rubypeople.rdt.core.ILoadpathContainer;
import org.rubypeople.rdt.core.ILoadpathEntry;
-import org.rubypeople.rdt.core.IRubyModel;
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.LoadpathContainerInitializer;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
-import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.wizards.NewWizardMessages;
import org.rubypeople.rdt.ui.RubyUI;
@@ -47,7 +43,7 @@
*/
public class BuildPathSupport {
- public static final String JRE_PREF_PAGE_ID= "org.eclipse.jdt.debug.ui.preferences.VMPreferencePage"; //$NON-NLS-1$
+ public static final String JRE_PREF_PAGE_ID= "org.rubypeople.rdt.debug.ui.preferences.VMPreferencePage"; //$NON-NLS-1$
private BuildPathSupport() {
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/FolderSelectionDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/FolderSelectionDialog.java 2007-06-20 20:19:28 UTC (rev 2646)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/FolderSelectionDialog.java 2007-06-20 20:47:59 UTC (rev 2647)
@@ -36,7 +36,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.dialogs.NewFolderDialog;
import org.eclipse.ui.views.navigator.ResourceSorter;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java 2007-06-20 20:19:28 UTC (rev 2646)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java 2007-06-20 20:47:59 UTC (rev 2647)
@@ -38,7 +38,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/LoadpathContainerSelectionPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/LoadpathContainerSelectionPage.java 2007-06-20 20:19:28 UTC (rev 2646)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/buildpaths/LoadpathContainerSelectionPage.java 2007-06-20 20:47:59 UTC (rev 2647)
@@ -36,8 +36,6 @@
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.RubyPluginImages;
import org.rubypeople.rdt.internal.ui.util.SelectionUtil;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/FindReferencesAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/FindReferencesAction.java 2007-06-20 20:19:28 UTC (rev 2646)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/FindReferencesAction.java 2007-06-20 20:47:59 UTC (rev 2647)
@@ -27,7 +27,6 @@
import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditor;
import org.rubypeople.rdt.internal.ui.search.RubySearchScopeFactory;
import org.rubypeople.rdt.internal.ui.search.SearchMessages;
-import org.rubypeople.rdt.internal.ui.search.SearchUtil;
import org.rubypeople.rdt.ui.search.ElementQuerySpecification;
import org.rubypeople.rdt.ui.search.QuerySpecification;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-20 20:19:29
|
Revision: 2646
http://svn.sourceforge.net/rubyeclipse/?rev=2646&view=rev
Author: cawilliams
Date: 2007-06-20 13:19:28 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
handle null project name
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java 2007-06-20 19:42:01 UTC (rev 2645)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java 2007-06-20 20:19:28 UTC (rev 2646)
@@ -138,6 +138,7 @@
e.printStackTrace();
return null;
}
+ if (projectName == null) return null;
return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-20 19:42:06
|
Revision: 2645
http://svn.sourceforge.net/rubyeclipse/?rev=2645&view=rev
Author: cawilliams
Date: 2007-06-20 12:42:01 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
fix broken test
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java
trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/TC_RubyConsoleTracker.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java 2007-06-20 16:45:57 UTC (rev 2644)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java 2007-06-20 19:42:01 UTC (rev 2645)
@@ -107,15 +107,7 @@
String text = fConsole.getDocument().get(offset, length);
while (StackTraceLine.isTraceLine(text)) {
- String projectName = null;
- try {
- projectName = fConsole.getProcess().getLaunch().getLaunchConfiguration().getAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null);
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- StackTraceLine stackTraceLine = new StackTraceLine(text, project);
+ StackTraceLine stackTraceLine = new StackTraceLine(text, getProject());
if (! existanceChecker.fileExists(stackTraceLine.getFilename()))
return;
IHyperlink link = new RubyStackTraceHyperlink(fConsole, stackTraceLine);
@@ -137,6 +129,18 @@
}
}
+ protected IProject getProject() {
+ String projectName = null;
+ try {
+ projectName = fConsole.getProcess().getLaunch().getLaunchConfiguration().getAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return null;
+ }
+ return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ }
+
/**
* @see org.eclipse.debug.ui.console.IConsoleLineTracker#dispose()
*/
Modified: trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/TC_RubyConsoleTracker.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/TC_RubyConsoleTracker.java 2007-06-20 16:45:57 UTC (rev 2644)
+++ trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/TC_RubyConsoleTracker.java 2007-06-20 19:42:01 UTC (rev 2645)
@@ -5,6 +5,7 @@
import junit.framework.TestCase;
+import org.eclipse.core.resources.IProject;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.debug.core.model.IStreamsProxy;
@@ -99,7 +100,14 @@
RubyConsoleTracker tracker ;
public TestConsole(FileExistanceChecker fileChecker) throws Exception {
- tracker = new RubyConsoleTracker(fileChecker);
+ tracker = new RubyConsoleTracker(fileChecker){
+
+ @Override
+ protected IProject getProject() {
+ return null;
+ }
+
+ };
tracker.init(this) ;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-20 16:46:01
|
Revision: 2644
http://svn.sourceforge.net/rubyeclipse/?rev=2644&view=rev
Author: cawilliams
Date: 2007-06-20 09:45:57 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
remove more deprecated code
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java 2007-06-20 16:45:43 UTC (rev 2643)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java 2007-06-20 16:45:57 UTC (rev 2644)
@@ -81,7 +81,7 @@
IFile rubyFile = project.getFile("run.rb");
rubyFile.create(new ByteArrayInputStream("puts 'a'\nputs 'b'".getBytes()), true, new NullProgressMonitor()) ;
- wc.setAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, rubyFile.getProject().getName());
+ wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, rubyFile.getProject().getName());
wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_FILE_NAME, rubyFile.getProjectRelativePath().toString());
//wc.setAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, RubyApplicationShortcut.getDefaultWorkingDirectory(rubyFile.getProject()));
wc.setAttribute(RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, RUBY_INTERPRETER_ID);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-20 16:45:44
|
Revision: 2643
http://svn.sourceforge.net/rubyeclipse/?rev=2643&view=rev
Author: cawilliams
Date: 2007-06-20 09:45:43 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
remove more deprecated code
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RubySourceLocator.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEntryPointTab.java
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_RubyArgumentsTab.java
trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyEntryPointTab.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RubySourceLocator.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RubySourceLocator.java 2007-06-20 16:42:22 UTC (rev 2642)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RubySourceLocator.java 2007-06-20 16:45:43 UTC (rev 2643)
@@ -16,6 +16,7 @@
import org.rubypeople.rdt.internal.debug.core.model.RubyStackFrame;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
import org.rubypeople.rdt.internal.ui.rubyeditor.ExternalRubyFileEditorInput;
+import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
import org.rubypeople.rdt.ui.IRubyConstants;
/**
@@ -53,7 +54,7 @@
* @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeDefaults(ILaunchConfiguration)
*/
public void initializeDefaults(ILaunchConfiguration configuration) throws CoreException {
- this.absoluteWorkingDirectory = configuration.getAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, ""); //$NON-NLS-1$
+ this.absoluteWorkingDirectory = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, ""); //$NON-NLS-1$
}
/**
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java 2007-06-20 16:42:22 UTC (rev 2642)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java 2007-06-20 16:45:43 UTC (rev 2643)
@@ -130,7 +130,7 @@
ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(rubyFile.getName()));
wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, rubyFile.getProject().getName());
wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_FILE_NAME, rubyFile.getProjectRelativePath().toString());
- wc.setAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, RubyApplicationShortcut.getDefaultWorkingDirectory(rubyFile.getProject()));
+ wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, RubyApplicationShortcut.getDefaultWorkingDirectory(rubyFile.getProject()));
wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, RubyRuntime.getDefaultVMInstall().getName());
wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, RubyRuntime.getDefaultVMInstall().getVMInstallType().getId());
wc.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "org.rubypeople.rdt.debug.ui.rubySourceLocator");
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java 2007-06-20 16:42:22 UTC (rev 2642)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java 2007-06-20 16:45:43 UTC (rev 2643)
@@ -92,7 +92,7 @@
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(RubyLaunchConfigurationAttribute.USE_DEFAULT_WORKING_DIRECTORY, true);
- configuration.setAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, (String)null);
+ configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
// set hidden attribute
configuration.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "org.rubypeople.rdt.debug.ui.rubySourceLocator") ;
}
@@ -101,7 +101,7 @@
String workingDirectory = "", interpreterArgs = "", programArgs = "";
boolean useDefaultWorkDir = true;
try {
- workingDirectory = configuration.getAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, "");
+ workingDirectory = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "");
interpreterArgs = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "");
programArgs = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
useDefaultWorkDir = configuration.getAttribute(RubyLaunchConfigurationAttribute.USE_DEFAULT_WORKING_DIRECTORY, true);
@@ -116,7 +116,7 @@
}
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, workingDirectorySelector.getValidatedSelectionText());
+ configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, workingDirectorySelector.getValidatedSelectionText());
configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, interpreterArgsText.getText());
configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArgsText.getText());
configuration.setAttribute(RubyLaunchConfigurationAttribute.USE_DEFAULT_WORKING_DIRECTORY, useDefaultWorkingDirectoryButton.getSelection());
@@ -139,7 +139,7 @@
public boolean isValid(ILaunchConfiguration launchConfig) {
try {
- String workingDirectory = launchConfig.getAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, "");
+ String workingDirectory = launchConfig.getAttribute(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "");
if (!useDefaultWorkingDirectoryButton() && workingDirectory.length() == 0) {
setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyArguments_working_dir_error_message);
return false;
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEntryPointTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEntryPointTab.java 2007-06-20 16:42:22 UTC (rev 2642)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEntryPointTab.java 2007-06-20 16:45:43 UTC (rev 2643)
@@ -70,13 +70,13 @@
if (project == null || !RubyCore.isRubyProject(project)) {
return ;
}
- configuration.setAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, project.getName());
+ configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_FILE_NAME, selectedResource.getProjectRelativePath().toString()) ;
}
public void initializeFrom(ILaunchConfiguration configuration) {
try {
- originalProjectName = configuration.getAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, "");
+ originalProjectName = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
originalFileName = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_FILE_NAME, "");
} catch (CoreException e) {
log(e);
@@ -89,7 +89,7 @@
}
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, projectSelector.getSelectionText());
+ configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectSelector.getSelectionText());
IFile file = fileSelector.getSelection();
configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_FILE_NAME, file == null ? "" : file.getProjectRelativePath().toString());
}
@@ -111,7 +111,7 @@
public boolean isValid(ILaunchConfiguration launchConfig) {
try {
- String projectName = launchConfig.getAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, "");
+ String projectName = launchConfig.getAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
if (projectName.length() == 0) {
setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidProjectSelectionMessage);
return false;
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-06-20 16:42:22 UTC (rev 2642)
+++ trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java 2007-06-20 16:45:43 UTC (rev 2643)
@@ -50,9 +50,9 @@
try {
ILaunchConfigurationType configType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(SHAM_LAUNCH_CONFIG_TYPE);
ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, pFile.getName());
- wc.setAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, pFile.getProject().getName());
+ wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, pFile.getProject().getName());
wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_FILE_NAME, pFile.getProjectRelativePath().toString());
- wc.setAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, "");
+ wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "");
wc.setAttribute(RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, RubyRuntime.getCompositeIdFromVM(RubyRuntime.getDefaultVMInstall()));
wc.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "org.rubypeople.rdt.debug.ui.rubySourceLocator");
config = wc.doSave();
Modified: trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyArgumentsTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyArgumentsTab.java 2007-06-20 16:42:22 UTC (rev 2642)
+++ trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyArgumentsTab.java 2007-06-20 16:45:43 UTC (rev 2643)
@@ -7,6 +7,7 @@
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages;
import org.rubypeople.rdt.internal.debug.ui.launcher.RubyArgumentsTab;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
+import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
public class TC_RubyArgumentsTab extends TestCase {
@@ -24,7 +25,7 @@
errorMessage = RdtDebugUiMessages.LaunchConfigurationTab_RubyArguments_working_dir_error_message;
assertEquals("The tab should set the error message for invalid working directory.", errorMessage, tab.getErrorMessage());
- configuration.setAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, "aValidDirectory");
+ configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "aValidDirectory");
assertTrue("The tab is valid when the configuration has a working directory.", tab.isValid(configuration));
assertNull("The tab should set the error message to null when there is a working directory.", tab.getErrorMessage());
}
Modified: trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyEntryPointTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyEntryPointTab.java 2007-06-20 16:42:22 UTC (rev 2642)
+++ trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyEntryPointTab.java 2007-06-20 16:45:43 UTC (rev 2643)
@@ -25,7 +25,7 @@
errorMessage = RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidProjectSelectionMessage;
assertEquals("The tab should set the error message for no project.", errorMessage, tab.getErrorMessage());
- configuration.setAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, "myProjectName");
+ configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, "myProjectName");
assertTrue("The tab is not valid when the configuration has only a projectname.", !tab.isValid(configuration));
errorMessage = RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidFileSelectionMessage;
assertEquals("The tab should set the error message for no file.", errorMessage, tab.getErrorMessage());
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java 2007-06-20 16:42:22 UTC (rev 2642)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java 2007-06-20 16:45:43 UTC (rev 2643)
@@ -10,21 +10,11 @@
public interface RubyLaunchConfigurationAttribute {
/**
- * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME</code>
- */
- static final String PROJECT_NAME = IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME;
-
- /**
* @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME</code>.
*/
static final String SELECTED_INTERPRETER = IRubyLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME;
-
+
/**
- * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY</code>
- */
- static final String WORKING_DIRECTORY = IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY;
-
- /**
* @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_DEFAULT_LOADPATH</code>
*/
static final String USE_DEFAULT_LOAD_PATH = IRubyLaunchConfigurationConstants.ATTR_DEFAULT_LOADPATH;
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-06-20 16:42:22 UTC (rev 2642)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-06-20 16:45:43 UTC (rev 2643)
@@ -168,11 +168,11 @@
}
public String getAttribute(String attributeName, String defaultValue) throws CoreException {
- if (attributeName.equals(RubyLaunchConfigurationAttribute.PROJECT_NAME)) {
+ if (attributeName.equals(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME)) {
return PROJECT_NAME;
} else if (attributeName.equals(IRubyLaunchConfigurationConstants.ATTR_FILE_NAME)) {
return RUBY_LIB_DIR + File.separator + RUBY_FILE_NAME;
- } else if (attributeName.equals(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY)) {
+ } else if (attributeName.equals(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY)) {
return '/' + PROJECT_NAME;
} else if (attributeName.equals(IRubyLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS)) {
return PROGRAM_ARGUMENTS;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-20 16:42:24
|
Revision: 2642
http://svn.sourceforge.net/rubyeclipse/?rev=2642&view=rev
Author: cawilliams
Date: 2007-06-20 09:42:22 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
remove some more deprecated code
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java 2007-06-20 16:40:00 UTC (rev 2641)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java 2007-06-20 16:42:22 UTC (rev 2642)
@@ -22,6 +22,7 @@
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
import org.rubypeople.rdt.internal.ui.util.DirectorySelector;
+import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
public class RubyArgumentsTab extends AbstractLaunchConfigurationTab {
protected Text interpreterArgsText, programArgsText;
@@ -101,8 +102,8 @@
boolean useDefaultWorkDir = true;
try {
workingDirectory = configuration.getAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, "");
- interpreterArgs = configuration.getAttribute(RubyLaunchConfigurationAttribute.INTERPRETER_ARGUMENTS, "");
- programArgs = configuration.getAttribute(RubyLaunchConfigurationAttribute.PROGRAM_ARGUMENTS, "");
+ interpreterArgs = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "");
+ programArgs = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
useDefaultWorkDir = configuration.getAttribute(RubyLaunchConfigurationAttribute.USE_DEFAULT_WORKING_DIRECTORY, true);
} catch (CoreException e) {
log(e);
@@ -116,8 +117,8 @@
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, workingDirectorySelector.getValidatedSelectionText());
- configuration.setAttribute(RubyLaunchConfigurationAttribute.INTERPRETER_ARGUMENTS, interpreterArgsText.getText());
- configuration.setAttribute(RubyLaunchConfigurationAttribute.PROGRAM_ARGUMENTS, programArgsText.getText());
+ configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, interpreterArgsText.getText());
+ configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArgsText.getText());
configuration.setAttribute(RubyLaunchConfigurationAttribute.USE_DEFAULT_WORKING_DIRECTORY, useDefaultWorkingDirectoryButton.getSelection());
}
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java 2007-06-20 16:40:00 UTC (rev 2641)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java 2007-06-20 16:42:22 UTC (rev 2642)
@@ -303,7 +303,7 @@
loadPathStrings.add(entry.getPath().toString());
}
configuration.setAttribute(
- RubyLaunchConfigurationAttribute.CUSTOM_LOAD_PATH,
+ IRubyLaunchConfigurationConstants.ATTR_LOADPATH,
loadPathStrings);
}
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java 2007-06-20 16:40:00 UTC (rev 2641)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java 2007-06-20 16:42:22 UTC (rev 2642)
@@ -10,26 +10,6 @@
public interface RubyLaunchConfigurationAttribute {
/**
- * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_LOADPATH</code>
- */
- static final String CUSTOM_LOAD_PATH = IRubyLaunchConfigurationConstants.ATTR_LOADPATH;
-
- /**
- * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_FILE_NAME</code>
- */
- static final String FILE_NAME = IRubyLaunchConfigurationConstants.ATTR_FILE_NAME;
-
- /**
- * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_VM_ARGUMENTS</code>
- */
- static final String INTERPRETER_ARGUMENTS = IRubyLaunchConfigurationConstants.ATTR_VM_ARGUMENTS;
-
- /**
- * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS</code>
- */
- static final String PROGRAM_ARGUMENTS = IRubyLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS;
-
- /**
* @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME</code>
*/
static final String PROJECT_NAME = IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME;
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-06-20 16:40:00 UTC (rev 2641)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-06-20 16:42:22 UTC (rev 2642)
@@ -174,7 +174,7 @@
return RUBY_LIB_DIR + File.separator + RUBY_FILE_NAME;
} else if (attributeName.equals(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY)) {
return '/' + PROJECT_NAME;
- } else if (attributeName.equals(RubyLaunchConfigurationAttribute.PROGRAM_ARGUMENTS)) {
+ } else if (attributeName.equals(IRubyLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS)) {
return PROGRAM_ARGUMENTS;
} else if (attributeName.equals(IRubyLaunchConfigurationConstants.ATTR_VM_ARGUMENTS)) {
return INTERPRETER_ARGUMENTS;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-20 16:40:01
|
Revision: 2641
http://svn.sourceforge.net/rubyeclipse/?rev=2641&view=rev
Author: cawilliams
Date: 2007-06-20 09:40:00 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
remove some deprecated code
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/CodeReloader.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java 2007-06-20 16:37:38 UTC (rev 2640)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java 2007-06-20 16:40:00 UTC (rev 2641)
@@ -74,7 +74,7 @@
public void testTwoSessions() throws Exception {
- ILaunchConfigurationType lcT = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(RubyLaunchConfigurationAttribute.RUBY_LAUNCH_CONFIGURATION_TYPE) ;
+ ILaunchConfigurationType lcT = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(IRubyLaunchConfigurationConstants.ID_RUBY_APPLICATION);
ILaunchConfigurationWorkingCopy wc = lcT.newInstance(null, "TestLaunchConfiguration") ;
IProject project = ResourceTools.createProject("FTCDebuggerLaunchMultipleSessions") ;
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/CodeReloader.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/CodeReloader.java 2007-06-20 16:37:38 UTC (rev 2640)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/CodeReloader.java 2007-06-20 16:40:00 UTC (rev 2641)
@@ -25,8 +25,8 @@
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.rubypeople.rdt.internal.debug.core.model.RubyDebugTarget;
-import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditor;
+import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
public class CodeReloader implements IPartListener, IPropertyListener, IWindowListener {
@@ -75,7 +75,7 @@
if (!launch.getLaunchMode().equals(ILaunchManager.DEBUG_MODE)) {
continue;
}
- if (!launch.getLaunchConfiguration().getType().getIdentifier().equals(RubyLaunchConfigurationAttribute.RUBY_LAUNCH_CONFIGURATION_TYPE)) {
+ if (!launch.getLaunchConfiguration().getType().getIdentifier().equals(IRubyLaunchConfigurationConstants.ID_RUBY_APPLICATION)) {
continue;
}
final RubyDebugTarget target = (RubyDebugTarget) launch.getDebugTarget();
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java 2007-06-20 16:37:38 UTC (rev 2640)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java 2007-06-20 16:40:00 UTC (rev 2641)
@@ -142,7 +142,7 @@
}
protected ILaunchConfigurationType getRubyLaunchConfigType() {
- return getLaunchManager().getLaunchConfigurationType(RubyLaunchConfigurationAttribute.RUBY_LAUNCH_CONFIGURATION_TYPE);
+ return getLaunchManager().getLaunchConfigurationType(IRubyLaunchConfigurationConstants.ID_RUBY_APPLICATION);
}
protected ILaunchManager getLaunchManager() {
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java 2007-06-20 16:37:38 UTC (rev 2640)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java 2007-06-20 16:40:00 UTC (rev 2641)
@@ -8,11 +8,6 @@
*
*/
public interface RubyLaunchConfigurationAttribute {
-
- /**
- * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ID_RUBY_APPLICATION</code>
- */
- static final String RUBY_LAUNCH_CONFIGURATION_TYPE = IRubyLaunchConfigurationConstants.ID_RUBY_APPLICATION;
/**
* @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_LOADPATH</code>
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-06-20 16:37:38 UTC (rev 2640)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-06-20 16:40:00 UTC (rev 2641)
@@ -105,7 +105,7 @@
public void testDebugEnabled() throws Exception {
// check if debugging is enabled in plugin.xml
- ILaunchConfigurationType launchConfigurationType = getLaunchManager().getLaunchConfigurationType(RubyLaunchConfigurationAttribute.RUBY_LAUNCH_CONFIGURATION_TYPE);
+ ILaunchConfigurationType launchConfigurationType = getLaunchManager().getLaunchConfigurationType(IRubyLaunchConfigurationConstants.ID_RUBY_APPLICATION);
assertEquals("Ruby Application", launchConfigurationType.getName());
assertTrue("LaunchConfiguration supports debug", launchConfigurationType.supportsMode(ILaunchManager.DEBUG_MODE));
}
@@ -113,7 +113,7 @@
public void launch(boolean debug) throws Exception {
ILaunchConfiguration configuration = new ShamLaunchConfiguration();
ILaunch launch = new Launch(configuration, debug ? ILaunchManager.DEBUG_MODE : ILaunchManager.RUN_MODE, null);
- ILaunchConfigurationType launchConfigurationType = getLaunchManager().getLaunchConfigurationType(RubyLaunchConfigurationAttribute.RUBY_LAUNCH_CONFIGURATION_TYPE);
+ ILaunchConfigurationType launchConfigurationType = getLaunchManager().getLaunchConfigurationType(IRubyLaunchConfigurationConstants.ID_RUBY_APPLICATION);
launchConfigurationType.getDelegate(debug ? "debug" : "run").launch(configuration, debug ? ILaunchManager.DEBUG_MODE : ILaunchManager.RUN_MODE, launch, null);
RubyDebugTarget debugTarget = (RubyDebugTarget) launch.getDebugTarget();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-20 16:37:40
|
Revision: 2640
http://svn.sourceforge.net/rubyeclipse/?rev=2640&view=rev
Author: cawilliams
Date: 2007-06-20 09:37:38 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
we no longer add project to loadpath on command line, and we don't force stdout/stderr to sync
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
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-06-20 15:32:32 UTC (rev 2639)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-06-20 16:37:38 UTC (rev 2640)
@@ -83,10 +83,6 @@
buffer.append(new Path(interpreter.getInstallLocation().getAbsolutePath()).append("bin").append("ruby").toOSString());
buffer.append("\" ");
buffer.append(INTERPRETER_ARGUMENTS);
- if (!debug) buffer.append(" -e STDOUT.sync=true -e STDERR.sync=true -e load($0=ARGV.shift)");
- buffer.append(" -I \"");
- buffer.append(project.getLocation().toOSString());
- buffer.append("\"");
if (debug) {
buffer.append(" -I ");
if (Platform.getOS().equals(Platform.OS_WIN32))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-20 15:33:24
|
Revision: 2639
http://svn.sourceforge.net/rubyeclipse/?rev=2639&view=rev
Author: cawilliams
Date: 2007-06-20 08:32:32 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
partition ruby files into code, single line comments, multi line comments and strings (new addition is strings). Adjust tests to meet new behavior/expectations.
This now allows us to embed code within strings (within code, ad infinitum).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/IRubyPartitions.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScanner.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubySourceViewerConfiguration.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubyTextTools.java
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/MergingPartitionScanner.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/IRubyPartitions.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/IRubyPartitions.java 2007-06-20 13:35:18 UTC (rev 2638)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/IRubyPartitions.java 2007-06-20 15:32:32 UTC (rev 2639)
@@ -16,6 +16,11 @@
* @since 0.7.0
*/
public final static String RUBY_PARTITIONING= "___ruby_partitioning"; //$NON-NLS-1$
+
+ /**
+ * The identifier default ruby code partition content type.
+ */
+ String RUBY_DEFAULT= "__ruby_default"; //$NON-NLS-1$
/**
* The identifier of the single-line end comment partition content type.
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/MergingPartitionScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/MergingPartitionScanner.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/MergingPartitionScanner.java 2007-06-20 15:32:32 UTC (rev 2639)
@@ -0,0 +1,92 @@
+package org.rubypeople.rdt.internal.ui.text;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.rules.IPartitionTokenScanner;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+
+/**
+ * Wraps the Ruby PartitonScanner and merges consecutive tokens with teh same data/partition marking.
+ * So if we have 10 default tokens in a row, this will eat up the ten and return a token that spans all of them.
+ *
+ * @author Chris Williams
+ *
+ */
+public class MergingPartitionScanner implements IPartitionTokenScanner {
+
+ private RubyPartitionScanner fScanner;
+ private int fOffset;
+ private int fLength;
+ private int newOffset = 0;
+ private int newLength = 0;
+ private IToken lastToken;
+
+ public MergingPartitionScanner() {
+ fScanner = new RubyPartitionScanner();
+ }
+
+ public void setPartialRange(IDocument document, int offset, int length,
+ String contentType, int partitionOffset) {
+ clear();
+ fScanner.setPartialRange(document, offset, length, contentType, partitionOffset);
+ }
+
+ public int getTokenLength() {
+ return fLength;
+ }
+
+ public int getTokenOffset() {
+ return fOffset;
+ }
+
+ public IToken nextToken() {
+ fLength = newLength;
+ fOffset = newOffset;
+ if (lastToken != null && lastToken.isEOF()) {
+ return lastToken;
+ }
+
+ IToken token = null;
+ while(!(token = fScanner.nextToken()).isEOF()) {
+ if (lastToken != null && token.getData().equals(lastToken.getData())) {
+// fLength = (fScanner.getTokenOffset() - fOffset) + fScanner.getTokenLength();
+// Assert.isTrue(fLength >= 0);
+ } else if (lastToken == null) {
+ lastToken = token;
+ fOffset = fScanner.getTokenOffset();
+ fLength = fScanner.getTokenLength();
+ } else {
+ fLength = (fScanner.getTokenOffset() - fOffset);
+ newOffset = fScanner.getTokenOffset();
+ newLength = fScanner.getTokenLength();
+ Assert.isTrue(newLength >= 0);
+ IToken returnToken = lastToken; // make a copy of the last token
+ lastToken = token; // save new token
+ return returnToken;
+ }
+ }
+ if (lastToken == null) {
+ return Token.EOF;
+ }
+ newOffset = fScanner.getTokenOffset();
+ newLength = 0;
+ IToken returnToken = lastToken; // make a copy of the last token
+ lastToken = Token.EOF; // save new token
+ return returnToken;
+ }
+
+ public void setRange(IDocument document, int offset, int length) {
+ clear();
+ fScanner.setRange(document, offset, length);
+ }
+
+ private void clear() {
+ lastToken = null;
+ fLength = 0;
+ fOffset = 0;
+ newLength = 0;
+ newOffset = 0;
+ }
+
+}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScanner.java 2007-06-20 13:35:18 UTC (rev 2638)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScanner.java 2007-06-20 15:32:32 UTC (rev 2639)
@@ -3,9 +3,12 @@
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.rules.IPartitionTokenScanner;
import org.eclipse.jface.text.rules.IToken;
@@ -19,11 +22,14 @@
import org.jruby.parser.ParserSupport;
import org.jruby.parser.RubyParserConfiguration;
import org.jruby.parser.RubyParserResult;
+import org.jruby.parser.Tokens;
import org.rubypeople.rdt.internal.core.util.ASTUtil;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
public class RubyPartitionScanner implements IPartitionTokenScanner {
+ private static final String BEGIN = "=begin";
+
private static class QueuedToken {
private IToken token;
private int length;
@@ -51,21 +57,25 @@
private RubyYaccLexer lexer;
private ParserSupport parserSupport;
private RubyParserResult result;
- private String contents;
+ private String fContents;
private LexerSource lexerSource;
private int origOffset;
private int origLength;
- private int tokenLength;
- private int tokenOffset;
+ private int fLength;
+ private int fOffset;
- private List<QueuedToken> queue = new ArrayList<QueuedToken>();
+ private List<QueuedToken> fQueue = new ArrayList<QueuedToken>();
+ private String fContentType;
- // XXX Also do strings, regex partitions!
+ // XXX Also do regex partitions!
public final static String RUBY_MULTI_LINE_COMMENT = IRubyPartitions.RUBY_MULTI_LINE_COMMENT;
public final static String RUBY_SINGLE_LINE_COMMENT = IRubyPartitions.RUBY_SINGLE_LINE_COMMENT;
+ public final static String RUBY_STRING = IRubyPartitions.RUBY_STRING;
+ public final static String RUBY_REGULAR_EXPRESSION = IRubyPartitions.RUBY_REGULAR_EXPRESSION;
+ public static final String RUBY_DEFAULT = IDocument.DEFAULT_CONTENT_TYPE;
public static final String[] LEGAL_CONTENT_TYPES = {
- RUBY_MULTI_LINE_COMMENT, RUBY_SINGLE_LINE_COMMENT
+ RUBY_DEFAULT, RUBY_MULTI_LINE_COMMENT, RUBY_SINGLE_LINE_COMMENT, RUBY_REGULAR_EXPRESSION, RUBY_STRING
};
public RubyPartitionScanner() {
@@ -81,15 +91,22 @@
public void setPartialRange(IDocument document, int offset, int length,
String contentType, int partitionOffset) {
reset();
- try {
- contents = document.get(offset, length);
- lexerSource = new LexerSource("filename", new StringReader(contents), 0);
+ int myOffset = offset;
+ if (contentType != null) {
+ int diff = offset - partitionOffset;
+ myOffset = partitionOffset; // backtrack to beginning of partition so we don't get in weird state
+ length += diff;
+ }
+ if (myOffset == -1) myOffset = 0;
+ try {
+ fContents = document.get(myOffset, length);
+ lexerSource = new LexerSource("filename", new StringReader(fContents), 0);
lexer.setSource(lexerSource);
} catch (BadLocationException e) {
lexerSource = new LexerSource("filename", new StringReader(""), 0);
lexer.setSource(lexerSource);
}
- origOffset = offset;
+ origOffset = myOffset;
origLength = length;
}
@@ -97,84 +114,255 @@
lexer.reset();
lexer.setState(LexState.EXPR_BEG);
parserSupport.initTopLocalVariables();
- queue.clear();
+ fQueue.clear();
}
public int getTokenLength() {
- return tokenLength;
+ return fLength;
}
public int getTokenOffset() {
- return tokenOffset;
+ return fOffset;
}
public IToken nextToken() {
- if (!queue.isEmpty()) {
- QueuedToken token = queue.remove(0);
- tokenOffset = token.getOffset();
- tokenLength = token.getLength();
- return token.getToken();
+ if (!fQueue.isEmpty()) {
+ return popTokenOffQueue();
}
- tokenOffset = getOffset();
- tokenLength = 0;
+ fOffset = getOffset();
+ fLength = 0;
IToken returnValue = new Token(null);
boolean isEOF = false;
try {
isEOF = !lexer.advance();
if (isEOF) {
returnValue = Token.EOF;
+ } else {
+ int lexerToken = lexer.token();
+ if (lexerToken == Tokens.tSTRING_DVAR) { // we hit a single dynamic variable
+ addPoundToken();
+ scanDynamicVariable();
+ setLexerPastDynamicSectionOfString();
+ return popTokenOffQueue();
+ } else if (lexerToken == Tokens.tSTRING_DBEG) { // if we hit dynamic code inside a string
+ addPoundBraceToken();
+ scanTokensInsideDynamicPortion();
+ addClosingBraceToken();
+ setLexerPastDynamicSectionOfString();
+ return popTokenOffQueue();
+ }
+ returnValue = getToken(lexerToken);
}
List comments = result.getCommentNodes();
if (comments != null && !comments.isEmpty()) {
- CommentNode comment;
- boolean firstComment = true;
- int endOffset = 0;
- boolean multiline = false;
- while (!comments.isEmpty()) {
- comment = (CommentNode) comments.remove(0);
- if (firstComment) {
- String src = ASTUtil.getSource(contents, comment);
- if (src != null && src.startsWith("=begin")) multiline = true;
- firstComment = false;
- tokenOffset = origOffset + comment.getPosition().getStartOffset(); // correct start offset, since when a line with nothing but spaces on it appears before comment, we get messed up positions
- }
- endOffset = origOffset + comment.getPosition().getEndOffset();
- }
- tokenLength = endOffset - tokenOffset;
- int queuedOffset = tokenOffset + tokenLength;
- int queuedLength = 0;
- if (!isEOF) {
- queuedLength = getOffset() - queuedOffset;
- } else {
- queuedOffset--;
- }
- // Throw saved token onto queue
- queue.add(new QueuedToken(returnValue, queuedOffset, queuedLength));
- String contentType = RUBY_SINGLE_LINE_COMMENT;
- if (multiline) contentType = RUBY_MULTI_LINE_COMMENT;
- return new Token(contentType);
+ parseOutComments(comments);
+ addQueuedToken(returnValue, isEOF); // Queue the normal token we just ate up
+ comments.clear();
+ return popTokenOffQueue();
}
} catch (SyntaxException se) {
+ if (se.getMessage().equals("embedded document meets end of file")) {
+ // TODO recover somehow by removing this chunk out of the fContents?
+ setOffset(se.getPosition().getStartOffset());
+ fLength = fContents.length() - se.getPosition().getStartOffset();
+ return new Token(RUBY_MULTI_LINE_COMMENT);
+ }
+
if (lexerSource.getOffset() - origLength == 0)
return Token.EOF; // return eof if we hit a problem found at
// end of parsing
else
- tokenLength = getOffset() - tokenOffset;
- return new Token(null);
+ fLength = getOffset() - fOffset;
+ return new Token(RUBY_DEFAULT);
} catch (IOException e) {
RubyPlugin.log(e);
}
if (!isEOF)
- tokenLength = getOffset() - tokenOffset;
+ fLength = getOffset() - fOffset;
return returnValue;
}
+ private void setOffset(int offset) {
+// Assert.isTrue(offset > fOffset);
+ fOffset = offset;
+ }
+
+ private void addPoundToken() {
+ addStringToken(1);// add token for the #
+ }
+
+ private void scanDynamicVariable() {
+ int whitespace = fContents.indexOf(' ', fOffset - origOffset); // read until whitespace or '"'
+ if (whitespace == -1) whitespace = Integer.MAX_VALUE;
+ int doubleQuote = fContents.indexOf('"', fOffset - origOffset);
+ if (doubleQuote == -1) doubleQuote = Integer.MAX_VALUE;
+ int end = Math.min(whitespace, doubleQuote);
+ // FIXME If we can't find whitespace or doubleQuote, we are pretty screwed.
+ String possible = null;
+ if (end == -1) {
+ possible = fContents.substring(fOffset - origOffset);
+ } else {
+ possible = fContents.substring(fOffset - origOffset, end);
+ }
+ RubyPartitionScanner scanner = new RubyPartitionScanner();
+ IDocument document = new Document(possible);
+ scanner.setRange(document, 0, possible.length());
+ IToken token;
+ while (!(token = scanner.nextToken()).isEOF()) {
+ push(new QueuedToken(token, scanner.getTokenOffset() + (fOffset), scanner.getTokenLength()));
+ }
+ setOffset(fOffset + possible.length());
+ }
+
+ private void scanTokensInsideDynamicPortion() {
+ String possible = new String(fContents.substring(fOffset - origOffset));
+ int end = possible.indexOf('}');// TODO Find the end brace '}' in a proper way!
+ if (end != -1) {
+ possible = possible.substring(0, end);
+ } else {
+ possible = possible.substring(0);
+ }
+ RubyPartitionScanner scanner = new RubyPartitionScanner();
+ IDocument document = new Document(possible);
+ scanner.setRange(document, 0, possible.length());
+ IToken token;
+ while (!(token = scanner.nextToken()).isEOF()) {
+ push(new QueuedToken(token, scanner.getTokenOffset() + fOffset, scanner.getTokenLength()));
+ }
+ setOffset(fOffset + possible.length());
+ }
+
+ private void addPoundBraceToken() {
+ addStringToken(2); // add token for the #{
+ }
+
+ private void addStringToken(int length) {
+ push(new QueuedToken(new Token(RUBY_STRING), fOffset, length));
+ setOffset(fOffset + length); // move past token
+ }
+
+ private void addClosingBraceToken() {
+ addStringToken(1);
+ }
+
+ private void setLexerPastDynamicSectionOfString() throws IOException {
+ IDocument document;
+ StringBuffer fakeContents = new StringBuffer();
+ int start = fOffset - 1;
+ for (int i = 0; i < start; i++) {
+ fakeContents.append(" ");
+ }
+ fakeContents.append('"');
+ if ((fOffset - origOffset) < origLength) {
+ fakeContents.append(new String(fContents.substring((fOffset - origOffset)))); // BLAH removed + 1 from end here
+ }
+ document = new Document(fakeContents.toString());
+ List<QueuedToken> queueCopy = new ArrayList<QueuedToken>(fQueue);
+ setPartialRange(document, start, fakeContents.length() - start, null, start);
+ fQueue = new ArrayList<QueuedToken>(queueCopy);
+ lexer.advance();
+ }
+
+ private void parseOutComments(List comments) {
+ int i = 0;
+ for (Iterator iter = comments.iterator(); iter.hasNext();) {
+ CommentNode comment = (CommentNode) iter.next();
+ int offset = correctOffset(comment);
+ int length = comment.getContent().length();
+ Token token = new Token(getContentType(comment));
+ push(new QueuedToken(token, offset, length));
+ i++;
+ }
+ }
+
+ private IToken popTokenOffQueue() {
+ QueuedToken token = fQueue.remove(0);
+ setOffset(token.getOffset());
+ Assert.isTrue(token.getLength() >= 0);
+ fLength = token.getLength();
+ return token.getToken();
+ }
+
+ private IToken getToken(int i) {
+ // If we hit a 32 (space) inside a qword, just return string content type (not default)
+ // FIXME IF we're in qwords, we should inspect the contents because it may be a variable
+ if (i == 32) {
+ return new Token(fContentType);
+ }
+ switch (i) {
+ case Tokens.tSTRING_CONTENT:
+ return new Token(RUBY_STRING);
+ case Tokens.tSTRING_BEG:
+ return new Token(RUBY_STRING);
+ case Tokens.tQWORDS_BEG:
+ fContentType = RUBY_STRING;
+ return new Token(RUBY_STRING);
+ case Tokens.tSTRING_END:
+ fContentType = RUBY_DEFAULT;
+ return new Token(RUBY_STRING);
+ case Tokens.tREGEXP_BEG:
+ return new Token(RUBY_REGULAR_EXPRESSION);
+ case Tokens.tREGEXP_END:
+ return new Token(RUBY_REGULAR_EXPRESSION);
+ default:
+ return new Token(RUBY_DEFAULT);
+ }
+ }
+
+ /**
+ * Grabs the end of the comment
+ * @param comments
+ * @return
+ */
+ private int getEndOfComment(CommentNode comment) {
+ return origOffset + comment.getPosition().getEndOffset();
+ }
+
+ /**
+ * correct start offset, since when a line with nothing but spaces on it appears before comment,
+ * we get messed up positions
+ */
+ private int correctOffset(CommentNode comment) {
+ return origOffset + comment.getPosition().getStartOffset();
+ }
+
+ private boolean isCommentMultiLine(CommentNode comment) {
+ String src = ASTUtil.getSource(fContents, comment);
+ if (src != null && src.startsWith(BEGIN)) return true;
+ return false;
+ }
+
+ private String getContentType(CommentNode comment) {
+ if (isCommentMultiLine(comment)) return RUBY_MULTI_LINE_COMMENT;
+ return RUBY_SINGLE_LINE_COMMENT;
+ }
+
+ private void addQueuedToken(IToken returnValue, boolean isEOF) {
+ // grab end of last comment (last thing in queue)
+ QueuedToken token = peek();
+ setOffset(token.getOffset() + token.getLength());
+ int length = getOffset() - fOffset;
+ if (length < 0 ) {
+ length = 0;
+ }
+ push(new QueuedToken(returnValue, fOffset, length));
+ }
+
+ private QueuedToken peek() {
+ return fQueue.get(fQueue.size() - 1);
+ }
+
+ private void push(QueuedToken token) {
+ Assert.isTrue(token.getLength() >= 0);
+ fQueue.add(token);
+ }
+
private int getOffset() {
return lexerSource.getOffset() + origOffset;
}
public void setRange(IDocument document, int offset, int length) {
- setPartialRange(document, offset, length, null, 0);
+ setPartialRange(document, offset, length, null, -1);
}
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java 2007-06-20 13:35:18 UTC (rev 2638)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java 2007-06-20 15:32:32 UTC (rev 2639)
@@ -33,7 +33,7 @@
private static String[] fgTokenProperties = { IRubyColorConstants.RUBY_KEYWORD, IRubyColorConstants.RUBY_DEFAULT,
IRubyColorConstants.RUBY_FIXNUM, IRubyColorConstants.RUBY_CHARACTER, IRubyColorConstants.RUBY_SYMBOL,
- IRubyColorConstants.RUBY_INSTANCE_VARIABLE, IRubyColorConstants.RUBY_GLOBAL, IRubyColorConstants.RUBY_STRING,
+ IRubyColorConstants.RUBY_INSTANCE_VARIABLE, IRubyColorConstants.RUBY_GLOBAL,
IRubyColorConstants.RUBY_REGEXP, IRubyColorConstants.RUBY_ERROR
// TODO Add Ability to set colors for return and operators
// IRubyColorConstants.RUBY_METHOD_NAME,
@@ -47,7 +47,6 @@
private int tokenLength;
private int oldOffset;
private boolean isInRegexp;
- private boolean isInString;
private boolean isInSymbol;
private boolean inAlias;
private RubyParserResult result;
@@ -81,7 +80,7 @@
IToken returnValue = getToken(IRubyColorConstants.RUBY_DEFAULT);
boolean isEOF = false;
try {
- isEOF = !lexer.advance();
+ isEOF = !lexer.advance(); // FIXME if we're assigning a string to a variable we may get a NumberformatException here!
if (isEOF) {
returnValue = Token.EOF;
} else {
@@ -90,10 +89,12 @@
} catch (SyntaxException se) {
if (lexerSource.getOffset() - origLength == 0)
return Token.EOF; // return eof if we hit a problem found at
- // end of parsing
- else
- tokenLength = getOffset() - oldOffset;
+ // end of parsing
+ tokenLength = getOffset() - oldOffset;
return getToken(IRubyColorConstants.RUBY_ERROR);
+ } catch (NumberFormatException nfe) {
+ tokenLength = getOffset() - oldOffset;
+ return returnValue;
} catch (IOException e) {
RubyPlugin.log(e);
}
@@ -111,8 +112,6 @@
return super.getToken(IRubyColorConstants.RUBY_SYMBOL);
if (isInRegexp)
return super.getToken(IRubyColorConstants.RUBY_REGEXP);
- if (isInString)
- return super.getToken(IRubyColorConstants.RUBY_STRING);
return super.getToken(key);
}
@@ -152,14 +151,6 @@
if ((((oldOffset - origOffset) + 1) < contents.length()) && (contents.charAt((oldOffset - origOffset) + 1) == '?'))
return doGetToken(IRubyColorConstants.RUBY_CHARACTER);
return doGetToken(IRubyColorConstants.RUBY_FIXNUM);
- case Tokens.tSTRING_CONTENT:
- return doGetToken(IRubyColorConstants.RUBY_STRING);
- case Tokens.tSTRING_BEG:
- isInString = true;
- return doGetToken(IRubyColorConstants.RUBY_STRING);
- case Tokens.tSTRING_END:
- isInString = false;
- return doGetToken(IRubyColorConstants.RUBY_STRING);
case Tokens.tREGEXP_BEG:
isInRegexp = true;
return doGetToken(IRubyColorConstants.RUBY_REGEXP);
@@ -228,7 +219,6 @@
isInSymbol = false;
if (offset == 0) {
isInRegexp = false;
- isInString = false;
}
try {
contents = document.get(offset, length);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubySourceViewerConfiguration.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubySourceViewerConfiguration.java 2007-06-20 13:35:18 UTC (rev 2638)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubySourceViewerConfiguration.java 2007-06-20 15:32:32 UTC (rev 2639)
@@ -64,6 +64,7 @@
import org.rubypeople.rdt.internal.ui.text.ruby.RubyFormattingStrategy;
import org.rubypeople.rdt.internal.ui.text.ruby.RubyReconcilingStrategy;
import org.rubypeople.rdt.internal.ui.text.ruby.RubyTokenScanner;
+import org.rubypeople.rdt.internal.ui.text.ruby.SingleTokenRubyScanner;
import org.rubypeople.rdt.internal.ui.text.ruby.hover.RubyEditorTextHoverDescriptor;
import org.rubypeople.rdt.internal.ui.text.ruby.hover.RubyEditorTextHoverProxy;
import org.rubypeople.rdt.internal.ui.text.ruby.hover.RubyInformationProvider;
@@ -89,7 +90,7 @@
protected AbstractRubyTokenScanner fCodeScanner;
- protected AbstractRubyScanner fMultilineCommentScanner, fSinglelineCommentScanner;
+ protected AbstractRubyScanner fMultilineCommentScanner, fSinglelineCommentScanner, fStringScanner;
private RubyDoubleClickSelector fRubyDoubleClickSelector;
private RubyCompletionProcessor fRubyCp;
@@ -167,7 +168,8 @@
* @since 0.8.0
*/
public boolean affectsTextPresentation(PropertyChangeEvent event) {
- return fCodeScanner.affectsBehavior(event) || fMultilineCommentScanner.affectsBehavior(event) || fSinglelineCommentScanner.affectsBehavior(event);
+ return fCodeScanner.affectsBehavior(event) || fMultilineCommentScanner.affectsBehavior(event)
+ || fSinglelineCommentScanner.affectsBehavior(event) || fStringScanner.affectsBehavior(event);
}
/**
@@ -192,6 +194,8 @@
fMultilineCommentScanner.adaptToPreferenceChange(event);
if (fSinglelineCommentScanner.affectsBehavior(event))
fSinglelineCommentScanner.adaptToPreferenceChange(event);
+ if (fStringScanner.affectsBehavior(event))
+ fStringScanner.adaptToPreferenceChange(event);
}
/**
@@ -204,6 +208,7 @@
fCodeScanner = new RubyTokenScanner(getColorManager(), fPreferenceStore);
fMultilineCommentScanner = new RubyCommentScanner(getColorManager(), fPreferenceStore, IRubyColorConstants.RUBY_MULTI_LINE_COMMENT);
fSinglelineCommentScanner = new RubyCommentScanner(getColorManager(), fPreferenceStore, IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT);
+ fStringScanner = new SingleTokenRubyScanner(getColorManager(), fPreferenceStore, IRubyColorConstants.RUBY_STRING);
}
/**
@@ -240,6 +245,10 @@
dr = new DefaultDamagerRepairer(getSinglelineCommentScanner());
reconciler.setDamager(dr, RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT);
reconciler.setRepairer(dr, RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT);
+
+ dr = new DefaultDamagerRepairer(getStringScanner());
+ reconciler.setDamager(dr, RubyPartitionScanner.RUBY_STRING);
+ reconciler.setRepairer(dr, RubyPartitionScanner.RUBY_STRING);
return reconciler;
}
@@ -254,9 +263,13 @@
protected ITokenScanner getSinglelineCommentScanner() {
return fSinglelineCommentScanner;
}
+
+ protected ITokenScanner getStringScanner() {
+ return fStringScanner;
+ }
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- return new String[] { IDocument.DEFAULT_CONTENT_TYPE, RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT, RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT };
+ return new String[] { IDocument.DEFAULT_CONTENT_TYPE, RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT, RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT, RubyPartitionScanner.RUBY_STRING };
}
/*
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubyTextTools.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubyTextTools.java 2007-06-20 13:35:18 UTC (rev 2638)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubyTextTools.java 2007-06-20 15:32:32 UTC (rev 2639)
@@ -11,11 +11,11 @@
import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.text.rules.DefaultPartitioner;
import org.eclipse.jface.text.rules.IPartitionTokenScanner;
-import org.eclipse.jface.text.rules.ITokenScanner;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditorPreferences;
+import org.rubypeople.rdt.internal.ui.text.MergingPartitionScanner;
import org.rubypeople.rdt.internal.ui.text.IRubyColorConstants;
import org.rubypeople.rdt.internal.ui.text.RubyColorManager;
import org.rubypeople.rdt.internal.ui.text.RubyCommentScanner;
@@ -23,6 +23,7 @@
import org.rubypeople.rdt.internal.ui.text.ruby.AbstractRubyScanner;
import org.rubypeople.rdt.internal.ui.text.ruby.AbstractRubyTokenScanner;
import org.rubypeople.rdt.internal.ui.text.ruby.RubyTokenScanner;
+import org.rubypeople.rdt.internal.ui.text.ruby.SingleTokenRubyScanner;
public class RubyTextTools {
@@ -44,9 +45,9 @@
protected static String[] keywords;
protected RubyColorManager fColorManager;
- protected RubyPartitionScanner partitionScanner;
+ protected IPartitionTokenScanner partitionScanner;
protected AbstractRubyTokenScanner fCodeScanner;
- protected AbstractRubyScanner fMultilineCommentScanner, fSinglelineCommentScanner;
+ protected AbstractRubyScanner fMultilineCommentScanner, fSinglelineCommentScanner, FStringScanner;
private IPreferenceStore fPreferenceStore;
private Preferences fCorePreferenceStore;
/** The preference change listener */
@@ -103,13 +104,15 @@
super();
fColorManager = new RubyColorManager(autoDisposeOnDisplayDispose);
- partitionScanner = new RubyPartitionScanner();
+ partitionScanner = new MergingPartitionScanner();
fCodeScanner = new RubyTokenScanner(fColorManager, store);
fMultilineCommentScanner = new RubyCommentScanner(fColorManager, store, coreStore,
IRubyColorConstants.RUBY_MULTI_LINE_COMMENT);
fSinglelineCommentScanner = new RubyCommentScanner(fColorManager, store, coreStore,
IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT);
+ FStringScanner = new SingleTokenRubyScanner(fColorManager, store,
+ IRubyColorConstants.RUBY_STRING);
fPreferenceStore = store;
fPreferenceStore.addPropertyChangeListener(fPreferenceListener);
@@ -133,7 +136,9 @@
if (fMultilineCommentScanner.affectsBehavior(event))
fMultilineCommentScanner.adaptToPreferenceChange(event);
if (fSinglelineCommentScanner.affectsBehavior(event))
- fSinglelineCommentScanner.adaptToPreferenceChange(event);
+ fSinglelineCommentScanner.adaptToPreferenceChange(event);
+ if (FStringScanner.affectsBehavior(event))
+ FStringScanner.adaptToPreferenceChange(event);
}
public IDocumentPartitioner createDocumentPartitioner() {
@@ -145,30 +150,6 @@
return partitionScanner;
}
- /**
- * @deprecated As of 0.8.0, replaced by
- * {@link RubySourceViewerConfiguration#getCodeScanner()}
- */
- public AbstractRubyTokenScanner getCodeScanner() {
- return fCodeScanner;
- }
-
- /**
- * @deprecated As of 0.8.0, replaced by
- * {@link RubySourceViewerConfiguration#getMultilineCommentScanner()}
- */
- public ITokenScanner getMultilineCommentScanner() {
- return fMultilineCommentScanner;
- }
-
- /**
- * @deprecated As of 0.8.0, replaced by
- * {@link RubySourceViewerConfiguration#getSingleineCommentScanner()}
- */
- public ITokenScanner getSinglelineCommentScanner() {
- return fSinglelineCommentScanner;
- }
-
public IPreferenceStore getPreferenceStore() {
return RubyPlugin.getDefault().getPreferenceStore();
}
@@ -192,7 +173,8 @@
public boolean affectsTextPresentation(PropertyChangeEvent event) {
return fCodeScanner.affectsBehavior(event)
|| fMultilineCommentScanner.affectsBehavior(event)
- || fSinglelineCommentScanner.affectsBehavior(event);
+ || fSinglelineCommentScanner.affectsBehavior(event)
+ || FStringScanner.affectsBehavior(event);
}
/**
Modified: trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java 2007-06-20 13:35:18 UTC (rev 2638)
+++ trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java 2007-06-20 15:32:32 UTC (rev 2639)
@@ -108,4 +108,73 @@
assertEquals(RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT, this.getContentType(source, 10));
assertEquals(RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT, this.getContentType(source, source.length() - 5));
}
+
+ public void testMultipleCommentsInARow() {
+ String code = "# comment 1\n# comment 2\nclass Chris\nend\n";
+
+ assertEquals(RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT, this.getContentType(code, 6));
+ assertEquals(RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT, this.getContentType(code, 17));
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 26));
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 29));
+ }
+
+ public void testCommentAfterEnd() {
+ String code = "class Chris\nend # comment\n";
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 12));
+ assertEquals(RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT, this.getContentType(code, 17));
+ }
+
+ public void testCommentAfterEndWhileEditing() {
+ String code = "=begin\r\n" +
+"c\r\n" +
+"=end\r\n" +
+"#hmm\r\n" +
+"#comment here why is ths\r\n" +
+"class Chris\r\n" +
+" def thing\r\n" +
+" end #ocmm \r\n" +
+"end";
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 76));
+ assertEquals(RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT, this.getContentType(code, 83));
+ }
+
+ public void testCommentAtEndOfLineWithStringAtBeginning() {
+ String code = "hash = {\n" +
+ " \"string\" => { # comment\n" +
+ " 123\n" +
+ " }\n" +
+ "}";
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 0));
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 4));
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 6));
+
+ assertEquals(RubyPartitionScanner.RUBY_STRING, this.getContentType(code, 8));
+ assertEquals(RubyPartitionScanner.RUBY_STRING, this.getContentType(code, 12));
+ assertEquals(RubyPartitionScanner.RUBY_STRING, this.getContentType(code, 18));
+
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 19));
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 22));
+
+ assertEquals(RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT, this.getContentType(code, 25));
+ }
+
+ public void testLinesWithJustSpaceBeforeComment() {
+ String code = " \n" +
+ " # comment\n" +
+ " def method\n" +
+ " \n" +
+ " end";
+ assertEquals(RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT, this.getContentType(code, 5));
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 14));
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 20));
+ }
+
+ public void testCommentsWithAlotOfPrecedingSpaces() {
+ String code = " # We \n" +
+ " # caller-requested until.\n" +
+ "return self\n";
+ assertEquals(RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT, this.getContentType(code, 16));
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 63));
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(code, 70));
+ }
}
Modified: trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java 2007-06-20 13:35:18 UTC (rev 2638)
+++ trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java 2007-06-20 15:32:32 UTC (rev 2639)
@@ -44,74 +44,6 @@
assertToken(IRubyColorConstants.RUBY_KEYWORD, 12, 3);
}
- public void testMultipleCommentsInARow() {
- String code = "# comment one\n#comment two\nclass Chris\nend\n";
- setUpScanner(code);
- assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 0, 26);
- assertToken(IRubyColorConstants.RUBY_KEYWORD, 26, 6); // '\nclass'
- assertToken(IRubyColorConstants.RUBY_DEFAULT, 32, 6); // ' Chris'
- assertToken(IRubyColorConstants.RUBY_DEFAULT, 38, 1); // '\n'
- assertToken(IRubyColorConstants.RUBY_KEYWORD, 39, 3); // 'end'
- }
-
- public void testCommentAfterEnd() {
- String code = "class Chris\nend # comment\n";
- setUpScanner(code);
- assertToken(IRubyColorConstants.RUBY_KEYWORD, 0, 5); // 'class'
- assertToken(IRubyColorConstants.RUBY_DEFAULT, 5, 6); // ' Chris'
- assertToken(IRubyColorConstants.RUBY_DEFAULT, 11, 1); // '\n'
- assertToken(IRubyColorConstants.RUBY_KEYWORD, 12, 3); // 'end'
- assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 16, 9); // '# comment'
- }
-
- public void testCommentAfterEndWhileEditing() {
- String code = "=begin\r\n" +
-"c\r\n" +
-"=end\r\n" +
-"#hmm\r\n" +
-"#comment here why is ths\r\n" +
-"class Chris\r\n" +
-" def thing\r\n" +
-" end #ocmm \r\n" +
-"end";
- setUpScanner(code, 75, 14);
- assertToken(IRubyColorConstants.RUBY_KEYWORD, 75, 5); // ' end'
- assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 82, 5); // '#ocmm'
- }
-
- public void testCommentAtEndOfLineWithStringAtBeginning() {
- String code = "hash = {\n" +
- " \"string\" => { # comment\n" +
- " 123\n" +
- " }\n" +
- "}";
- setUpScanner(code);
- assertToken(IRubyColorConstants.RUBY_DEFAULT, 0, 4); // 'hash'
- assertToken(IRubyColorConstants.RUBY_DEFAULT, 4, 2); // ' ='
- assertToken(IRubyColorConstants.RUBY_DEFAULT, 6, 2); // ' {'
-
- assertToken(IRubyColorConstants.RUBY_STRING, 8, 4); // whitespace
- assertToken(IRubyColorConstants.RUBY_STRING, 12, 6);
- assertToken(IRubyColorConstants.RUBY_STRING, 18, 1);
-
- assertToken(IRubyColorConstants.RUBY_DEFAULT, 19, 3);
- assertToken(IRubyColorConstants.RUBY_DEFAULT, 22, 2);
-
- assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 25, 9);
- }
-
- public void testLinesWithJustSpaceBeforeComment() {
- String code = " \n" +
- " # comment\n" +
- " def method\n" +
- " \n" +
- " end";
- setUpScanner(code);
- assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 5, 9); // '# comment'
- assertToken(IRubyColorConstants.RUBY_KEYWORD, 14, 6); // '\n def'
- assertToken(IRubyColorConstants.RUBY_DEFAULT, 20, 7); // ' method'
- }
-
public void testSymbolAtEndOfLine() {
String code = " helper_method :logged_in?\n" +
" def method\n" +
@@ -136,16 +68,6 @@
assertToken(IRubyColorConstants.RUBY_DEFAULT, 11, 1); // ']'
}
- public void testCommentsWithAlotOfPrecedingSpaces() {
- String code = " # We \n" +
- " # caller-requested until.\n" +
- "return self\n";
- setUpScanner(code);
- assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 16, 47); //
- assertToken(IRubyColorConstants.RUBY_KEYWORD, 63, 7); // 'return'
- assertToken(IRubyColorConstants.RUBY_KEYWORD, 70, 5); // ' self'
- }
-
public void testSymbolInsideParentheses() {
String code = "Object.const_defined?(:RedCloth)";
setUpScanner(code);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-20 13:35:27
|
Revision: 2638
http://svn.sourceforge.net/rubyeclipse/?rev=2638&view=rev
Author: cawilliams
Date: 2007-06-20 06:35:18 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
fix broken tests
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtTestCase.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IncrementalRdtCompiler.java
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtTestCase.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtTestCase.java 2007-06-20 13:10:54 UTC (rev 2637)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtTestCase.java 2007-06-20 13:35:18 UTC (rev 2638)
@@ -55,7 +55,7 @@
compiler.compile(monitor);
- assertCompliationFor(ListUtil.create(t1), 4);
+ assertCompilationFor(ListUtil.create(t1), 3);
}
public void testNotARubyFile() throws Exception {
@@ -64,7 +64,7 @@
compiler.compile(monitor);
- assertCompliationFor(ListUtil.create(), 0); // FIXME should be no work done for non-ruby file?
+ assertCompilationFor(ListUtil.create(), 0); // FIXME should be no work done for non-ruby file?
}
public void testCompileIncludesFolders() throws Exception {
@@ -74,7 +74,7 @@
compiler.compile(monitor);
- assertCompliationFor(ListUtil.create(t3), 4);
+ assertCompilationFor(ListUtil.create(t3), 3);
}
public void testCompileMultipleFiles() throws Exception {
@@ -83,12 +83,12 @@
setFiles(ListUtil.create(t1, t2));
compiler.compile(monitor);
- int expectedWorkUnits = 8; // code analyzer, taskparser, index, markers for each file
- assertCompliationFor(ListUtil.create(t1, t2), expectedWorkUnits);
+ int expectedWorkUnits = 6; // code analyzer, taskparser, index, markers for each file
+ assertCompilationFor(ListUtil.create(t1, t2), expectedWorkUnits);
}
public void testCancellation() throws Exception {
- monitor.cancelAfter(6);
+ monitor.cancelAfter(4);
project.addResource(t1);
project.addResource(t2);
setFiles(ListUtil.create(t1, t2));
@@ -96,8 +96,8 @@
compiler.compile(monitor);
List expectedFiles = ListUtil.create(t1);
- monitor.assertTaskBegun("Building test...", 8);
- monitor.assertDone(6);
+ monitor.assertTaskBegun("Building test...", 6);
+ monitor.assertDone(4);
List subTasks = ListUtil.create(REMOVING_MARKERS_SUB_TASK,
t1.getFullPath().toString());
monitor.assertSubTasks(subTasks);
@@ -114,13 +114,13 @@
compiler.compile(monitor);
- assertCompliationFor(ListUtil.create(t1), 4);
+ assertCompilationFor(ListUtil.create(t1), 3);
}
protected void setFiles(List filesForTest) throws Exception {
}
- protected void assertCompliationFor(List expectedFiles, int totalWork) {
+ protected void assertCompilationFor(List expectedFiles, int totalWork) {
monitor.assertTaskBegun("Building test...", totalWork);
monitor.assertDone(totalWork);
List subTasks = ListUtil.create(REMOVING_MARKERS_SUB_TASK);
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IncrementalRdtCompiler.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IncrementalRdtCompiler.java 2007-06-20 13:10:54 UTC (rev 2637)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IncrementalRdtCompiler.java 2007-06-20 13:35:18 UTC (rev 2638)
@@ -22,8 +22,8 @@
compiler.compile(monitor);
ListUtil.create(t1); //expected files
- monitor.assertTaskBegun("Building test...", 2);
- monitor.assertDone(2);
+ monitor.assertTaskBegun("Building test...", 1);
+ monitor.assertDone(1);
List subTasks = ListUtil.create(REMOVING_MARKERS_SUB_TASK);
monitor.assertSubTasks(subTasks);
assertMarkersRemoved(ListUtil.create(t1));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-20 13:11:11
|
Revision: 2637
http://svn.sourceforge.net/rubyeclipse/?rev=2637&view=rev
Author: cawilliams
Date: 2007-06-20 06:10:54 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
ok, now that I logged into the build server and accepted the cert permanenetly switch back to new URL/host name
Modified Paths:
--------------
trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config
Modified: trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config
===================================================================
--- trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config 2007-06-20 12:54:38 UTC (rev 2636)
+++ trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config 2007-06-20 13:10:54 UTC (rev 2637)
@@ -7,6 +7,6 @@
pluginbuilder.is.svn=true
autotestsuite.class.inclusions=.*
pluginbuilder.is.runtests=true
-pluginbuilder.svn.url=https\://svn.sourceforge.net/svnroot/rubyeclipse/trunk
+pluginbuilder.svn.url=https\://rubyeclipse.svn.sourceforge.net/svnroot/rubyeclipse/trunk
autotestsuite.plugin.inclusions=.*(test|tests)$
pluginbuilder.is.cvs=false
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-20 12:54:40
|
Revision: 2636
http://svn.sourceforge.net/rubyeclipse/?rev=2636&view=rev
Author: cawilliams
Date: 2007-06-20 05:54:38 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
try switching back since cert isn't trusted from new host name
Modified Paths:
--------------
trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config
Modified: trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config
===================================================================
--- trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config 2007-06-19 18:18:46 UTC (rev 2635)
+++ trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config 2007-06-20 12:54:38 UTC (rev 2636)
@@ -7,6 +7,6 @@
pluginbuilder.is.svn=true
autotestsuite.class.inclusions=.*
pluginbuilder.is.runtests=true
-pluginbuilder.svn.url=https\://rubyeclipse.svn.sourceforge.net/svnroot/rubyeclipse/trunk
+pluginbuilder.svn.url=https\://svn.sourceforge.net/svnroot/rubyeclipse/trunk
autotestsuite.plugin.inclusions=.*(test|tests)$
pluginbuilder.is.cvs=false
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-19 18:18:49
|
Revision: 2635
http://svn.sourceforge.net/rubyeclipse/?rev=2635&view=rev
Author: cawilliams
Date: 2007-06-19 11:18:46 -0700 (Tue, 19 Jun 2007)
Log Message:
-----------
parse out the test filename properly (basically just take it as it is, don't try to do escaped characters)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java 2007-06-19 18:18:31 UTC (rev 2634)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java 2007-06-19 18:18:46 UTC (rev 2635)
@@ -480,17 +480,10 @@
}
private int scanTestName(String s, int start, StringBuffer testName) {
- boolean inQuote = false;
int i = start;
for (; i < s.length(); i++) {
char c = s.charAt(i);
- if (c == '\\' && !inQuote) {
- inQuote = true;
- continue;
- } else if (inQuote) {
- inQuote = false;
- testName.append(c);
- } else if (c == ',')
+ if (c == ',')
break;
else
testName.append(c);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-19 18:18:38
|
Revision: 2634
http://svn.sourceforge.net/rubyeclipse/?rev=2634&view=rev
Author: cawilliams
Date: 2007-06-19 11:18:31 -0700 (Tue, 19 Jun 2007)
Log Message:
-----------
make sure type isn't null to avoid null pointer exceptions
Modified Paths:
--------------
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java 2007-06-19 16:02:37 UTC (rev 2633)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java 2007-06-19 18:18:31 UTC (rev 2634)
@@ -501,7 +501,7 @@
setViewPartTitle(type);
if (type instanceof IType)
setTitleToolTip(((IType)type).getFullyQualifiedName());
- else
+ else if (type != null)
setTitleToolTip(type.getElementName());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-19 16:02:38
|
Revision: 2633
http://svn.sourceforge.net/rubyeclipse/?rev=2633&view=rev
Author: cawilliams
Date: 2007-06-19 09:02:37 -0700 (Tue, 19 Jun 2007)
Log Message:
-----------
add another test for the bugfix from before, just to make sure
Modified Paths:
--------------
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java
Added Paths:
-----------
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/matt.txt
Modified: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java 2007-06-19 15:04:30 UTC (rev 2632)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java 2007-06-19 16:02:37 UTC (rev 2633)
@@ -29,6 +29,13 @@
Set<Gem> gems = parser.parse(contents);
assertEquals(21, gems.size());
}
+
+ public void testMattsBrokenList() {
+ GemParser parser = new GemParser();
+ String contents = getContents("src/com/aptana/rdt/internal/core/gems/matt.txt");
+ Set<Gem> gems = parser.parse(contents);
+ assertEquals(22, gems.size());
+ }
private String getContents(String path) {
File file = AptanaRDTTests.getFileInPlugin(new Path(path));
Added: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/matt.txt
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/matt.txt (rev 0)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/matt.txt 2007-06-19 16:02:37 UTC (rev 2633)
@@ -0,0 +1,81 @@
+
+*** LOCAL GEMS ***
+
+actionmailer (1.3.3)
+ Service layer for easy email delivery and testing.
+
+actionpack (1.13.3)
+ Web-flow and rendering framework putting the VC in MVC.
+
+actionwebservice (1.2.3)
+ Web service support for Action Pack.
+
+activerecord (1.15.3)
+ Implements the ActiveRecord pattern for ORM.
+
+activesupport (1.4.2)
+ Support and utility classes used by the Rails framework.
+
+capistrano (1.4.1)
+ Capistrano is a framework and utility for executing commands in
+ parallel on multiple remote machines, via SSH. The primary goal is
+ to simplify and automate the deployment of web applications.
+
+cgi_multipart_eof_fix (2.1)
+ Fix an exploitable bug in CGI multipart parsing which affects Ruby
+ <= 1.8.5 when multipart boundary attribute contains a non-halting
+ regular expression string.
+
+daemons (1.0.6)
+ A toolkit to create and control daemons in different ways
+
+fastthread (1.0)
+ Optimized replacement for thread.rb primitives
+
+gem_plugin (0.2.2)
+ A plugin system based only on rubygems that uses dependencies only
+
+mongrel (1.0.1)
+ A small fast HTTP library and server that runs Rails, Camping, Nitro
+ and Iowa apps.
+
+mongrel_cluster (0.2.1)
+ Mongrel plugin that provides commands and Capistrano tasks for
+ managing multiple Mongrel processes.
+
+needle (1.3.0)
+ Needle is a Dependency Injection/Inversion of Control container for
+ Ruby. It supports both type-2 (setter) and type-3 (constructor)
+ injection. It takes advantage of the dynamic nature of Ruby to
+ provide a rich and flexible approach to injecting dependencies.
+
+net-sftp (1.1.0)
+ Net::SFTP is a pure-Ruby implementation of the SFTP client protocol.
+
+net-ssh (1.1.1)
+ Net::SSH is a pure-Ruby implementation of the SSH2 client protocol.
+
+rails (1.2.3)
+ Web-application framework with template engine, control-flow layer,
+ and ORM.
+
+rake (0.7.3)
+ Ruby based make-like utility.
+
+rcov (0.8.0.2)
+ Code coverage analysis tool for Ruby
+
+sources (0.0.1)
+ This package provides download sources for remote gem installation
+
+SQS (0.1.3)
+ A Ruby interface to Amazon's Simple Queue Service
+
+starfish (1.2.1)
+ Starfish is a utility to make distributed programming ridiculously
+ easy.
+
+termios (0.9.4)
+ Termios module are simple wrapper for termios(3). It can be included
+ into IO-family classes and can extend IO-family objects. In
+ addition, the methods can use as module function.
\ 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-06-19 15:04:31
|
Revision: 2632
http://svn.sourceforge.net/rubyeclipse/?rev=2632&view=rev
Author: cawilliams
Date: 2007-06-19 08:04:30 -0700 (Tue, 19 Jun 2007)
Log Message:
-----------
update icons for upgrade / upgrade all
Modified Paths:
--------------
trunk/com.aptana.rdt/icons/upgrade.gif
trunk/com.aptana.rdt/plugin.xml
Added Paths:
-----------
trunk/com.aptana.rdt/icons/ruby_get.png
Added: trunk/com.aptana.rdt/icons/ruby_get.png
===================================================================
(Binary files differ)
Property changes on: trunk/com.aptana.rdt/icons/ruby_get.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/com.aptana.rdt/icons/upgrade.gif
===================================================================
(Binary files differ)
Modified: trunk/com.aptana.rdt/plugin.xml
===================================================================
--- trunk/com.aptana.rdt/plugin.xml 2007-06-19 14:49:21 UTC (rev 2631)
+++ trunk/com.aptana.rdt/plugin.xml 2007-06-19 15:04:30 UTC (rev 2632)
@@ -192,7 +192,7 @@
tooltip="Refresh"/>
<action
class="com.aptana.rdt.internal.ui.actions.UpdateGemActionDelegate"
- icon="icons/upgrade.gif"
+ icon="icons/ruby_get.png"
id="com.aptana.gems.ui.ActionUpdateGem"
label="Update Gem"
style="push"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-19 14:49:24
|
Revision: 2631
http://svn.sourceforge.net/rubyeclipse/?rev=2631&view=rev
Author: cawilliams
Date: 2007-06-19 07:49:21 -0700 (Tue, 19 Jun 2007)
Log Message:
-----------
add test for Trac #4903, which makes sure it is fixed. Also don't even try to catch RuntimeExceptiosn in the GemParser - let them bubble up, or we'll eat up CPU and keep failing forever.
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.java
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java
Added Paths:
-----------
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/2line_description_end.txt
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.java 2007-06-19 14:27:41 UTC (rev 2630)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.java 2007-06-19 14:49:21 UTC (rev 2631)
@@ -23,35 +23,33 @@
}
return parseOutGems(lines);
}
-
+
public Set<Gem> parseOutGems(List<String> lines) {
Set<Gem> gems = new HashSet<Gem>();
for (int i = 0; i < lines.size();) {
- try {
- String nameAndVersion = lines.get(i);
- String description = "";
- if ((i + 1) < lines.size()) {
- description = lines.get(i + 1);
- }
- int j = 2;
- while (true) {
- if ((i + j) >= lines.size()) break; // if there is no next line, break out
- String nextLine = lines.get(i + j);
- if (nextLine.trim().length() == 0) break; // if line is empty, break out
- description += " " + nextLine.trim(); // add line to description
- j++; // move to next line
- }
- int openParen = nameAndVersion.indexOf('(');
- int closeParen = nameAndVersion.indexOf(')');
- String name = nameAndVersion.substring(0, openParen);
- String version = nameAndVersion
- .substring(openParen + 1, closeParen);
- gems.add(new Gem(name.trim(), version, description.trim()));
- i += (j + 1);
- } catch (RuntimeException e) {
- AptanaRDTPlugin.log(new IllegalStateException("Was unable to parse local gems correctly from: " + lines.toString()));
- AptanaRDTPlugin.log(e);
+ String nameAndVersion = lines.get(i);
+ String description = "";
+ if ((i + 1) < lines.size()) {
+ description = lines.get(i + 1);
}
+ int j = 2;
+ while (true) {
+ if ((i + j) >= lines.size())
+ break; // if there is no next line, break out
+ String nextLine = lines.get(i + j);
+ if (nextLine.trim().length() == 0)
+ break; // if line is empty, break out
+ description += " " + nextLine.trim(); // add line to
+ // description
+ j++; // move to next line
+ }
+ int openParen = nameAndVersion.indexOf('(');
+ int closeParen = nameAndVersion.indexOf(')');
+ String name = nameAndVersion.substring(0, openParen);
+ String version = nameAndVersion
+ .substring(openParen + 1, closeParen);
+ gems.add(new Gem(name.trim(), version, description.trim()));
+ i += (j + 1);
}
return gems;
}
Added: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/2line_description_end.txt
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/2line_description_end.txt (rev 0)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/2line_description_end.txt 2007-06-19 14:49:21 UTC (rev 2631)
@@ -0,0 +1,70 @@
+
+*** LOCAL GEMS ***
+
+actionmailer (1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.5, 1.2.4)
+ Service layer for easy email delivery and testing.
+
+actionpack (1.13.3, 1.13.2, 1.13.1, 1.13.0, 1.12.5, 1.12.4)
+ Web-flow and rendering framework putting the VC in MVC.
+
+actionwebservice (1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 0.9.4)
+ Web service support for Action Pack.
+
+activerecord (1.15.3, 1.15.2, 1.15.1, 1.15.0, 1.14.4)
+ Implements the ActiveRecord pattern for ORM.
+
+activesupport (1.4.2, 1.4.1, 1.4.0, 1.3.1)
+ Support and utility classes used by the Rails framework.
+
+cgi_multipart_eof_fix (2.1)
+ Fix an exploitable bug in CGI multipart parsing which affects Ruby
+ <= 1.8.5 when multipart boundary attribute contains a non-halting
+ regular expression string.
+
+fastercsv (1.2.0)
+ FasterCSV is CSV, but faster, smaller, and cleaner.
+
+fxri (0.3.6)
+ Graphical interface to the RI documentation, with search engine.
+
+fxruby (1.6.11, 1.6.6)
+ FXRuby is the Ruby binding to the FOX GUI toolkit.
+
+gem_plugin (0.2.2)
+ A plugin system based only on rubygems that uses dependencies only
+
+hpricot (0.6, 0.4)
+ a swift, liberal HTML parser with a fantastic library
+
+log4r (1.0.5)
+ Log4r is a comprehensive and flexible logging library for Ruby.
+
+mongrel (1.0.1)
+ A small fast HTTP library and server that runs Rails, Camping, Nitro
+ and Iowa apps.
+
+rails (1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5)
+ Web-application framework with template engine, control-flow layer,
+ and ORM.
+
+rake (0.7.3, 0.7.2)
+ Ruby based make-like utility.
+
+rspec (1.0.5, 0.9.4)
+ RSpec-1.0.5 (r2081) - BDD for Ruby http://rspec.rubyforge.org/
+
+ruby-debug (0.9.3, 0.9.2)
+ Command line interface (CLI) for ruby-debug-base
+
+ruby-debug-base (0.9.3, 0.9.2)
+ Fast Ruby debugger
+
+ruby-debug-ide (0.1.6, 0.1.4, 0.1.2)
+ IDE interface for ruby-debug.
+
+sources (0.0.1)
+ This package provides download sources for remote gem installation
+
+sqlite3-ruby (1.2.1)
+ SQLite3/Ruby is a module to allow Ruby scripts to interface with a
+ SQLite database.
\ No newline at end of file
Modified: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java 2007-06-19 14:27:41 UTC (rev 2630)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java 2007-06-19 14:49:21 UTC (rev 2631)
@@ -22,6 +22,13 @@
Set<Gem> gems = parser.parse(contents);
assertEquals(31, gems.size());
}
+
+ public void testEndsWithTwoLineDescription() {
+ GemParser parser = new GemParser();
+ String contents = getContents("src/com/aptana/rdt/internal/core/gems/2line_description_end.txt");
+ Set<Gem> gems = parser.parse(contents);
+ assertEquals(21, gems.size());
+ }
private String getContents(String path) {
File file = AptanaRDTTests.getFileInPlugin(new Path(path));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-19 14:27:44
|
Revision: 2630
http://svn.sourceforge.net/rubyeclipse/?rev=2630&view=rev
Author: cawilliams
Date: 2007-06-19 07:27:41 -0700 (Tue, 19 Jun 2007)
Log Message:
-----------
add a new updateAll action and button to update all gems.
When refreshing local gems, save cached copy to file.
move out parsing of gems to GemParser class and add tests for parsing.
try to avoid index out of bounds exceptions when parsing local gems.
When launching interactive consoles for GemManager (install, update) set flag to make it not launch in background (so console should pop forward to user in case they need to provide input).
Modified Paths:
--------------
trunk/com.aptana.rdt/META-INF/MANIFEST.MF
trunk/com.aptana.rdt/plugin.xml
trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/IGemManager.java
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
trunk/com.aptana.rdt.tests/META-INF/MANIFEST.MF
Added Paths:
-----------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.java
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/ui/actions/UpdateAllActionDelegate.java
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/AptanaRDTTests.java
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/local.txt
Modified: trunk/com.aptana.rdt/META-INF/MANIFEST.MF
===================================================================
--- trunk/com.aptana.rdt/META-INF/MANIFEST.MF 2007-06-19 14:13:40 UTC (rev 2629)
+++ trunk/com.aptana.rdt/META-INF/MANIFEST.MF 2007-06-19 14:27:41 UTC (rev 2630)
@@ -8,9 +8,10 @@
Eclipse-LazyStart: true
Bundle-Vendor: Aptana, Inc.
Export-Package: com.aptana.rdt,
+ com.aptana.rdt.core.gems,
+ com.aptana.rdt.internal.core.gems;x-friends:="com.aptana.rdt.tests",
com.aptana.rdt.internal.parser.warnings,
- com.aptana.rdt.internal.ui.preferences,
- com.aptana.rdt.core.gems
+ com.aptana.rdt.internal.ui.preferences
Require-Bundle: org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.jface.text,
Modified: trunk/com.aptana.rdt/plugin.xml
===================================================================
--- trunk/com.aptana.rdt/plugin.xml 2007-06-19 14:13:40 UTC (rev 2629)
+++ trunk/com.aptana.rdt/plugin.xml 2007-06-19 14:27:41 UTC (rev 2630)
@@ -180,6 +180,7 @@
label="Remove"
style="push"
toolbarPath="additions"
+ enablesFor="1"
tooltip="Remove"/>
<action
class="com.aptana.rdt.internal.ui.actions.RefreshGemsActionDelegate"
@@ -195,8 +196,17 @@
id="com.aptana.gems.ui.ActionUpdateGem"
label="Update Gem"
style="push"
+ enablesFor="1"
toolbarPath="additions"
tooltip="Update Gem"/>
+ <action
+ class="com.aptana.rdt.internal.ui.actions.UpdateAllActionDelegate"
+ icon="icons/upgrade.gif"
+ id="com.aptana.gems.ui.ActionUpdateAllGems"
+ label="Update All Gems"
+ style="push"
+ toolbarPath="additions"
+ tooltip="Update All Gems"/>
</viewContribution>
</extension>
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/IGemManager.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/IGemManager.java 2007-06-19 14:13:40 UTC (rev 2629)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/IGemManager.java 2007-06-19 14:27:41 UTC (rev 2630)
@@ -30,4 +30,6 @@
public abstract IPath getGemPath(String gemName, String version);
+ public abstract boolean updateAll();
+
}
\ No newline at end of file
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-06-19 14:13:40 UTC (rev 2629)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-06-19 14:27:41 UTC (rev 2630)
@@ -311,44 +311,15 @@
private Set<Gem> loadLocalGems() {
ILaunchConfiguration config = createGemLaunchConfiguration(LIST_COMMAND + " " + LOCAL_SWITCH, false);
List<String> lines = readOutput(config);
- if (lines.size() > 2) {
- lines.remove(0); // Remove first 3 lines from local list
- lines.remove(0);
- lines.remove(0);
+ StringBuffer buffer = new StringBuffer();
+ for (int i = 0; i < lines.size(); i++) {
+ buffer.append(lines.get(i));
+ if (i < (lines.size() - 1)) buffer.append("\n");
}
- return parseOutGems(lines);
+ GemParser parser = new GemParser();
+ return parser.parse(buffer.toString());
}
- private Set<Gem> parseOutGems(List<String> lines) {
- Set<Gem> gems = new HashSet<Gem>();
- for (int i = 0; i < lines.size();) {
- try {
- String nameAndVersion = lines.get(i);
- String description = lines.get(i + 1);
- int j = 2;
- if ((i + 2) < lines.size()) {
- String nextLine = lines.get(i + 2);
- while (nextLine.trim().length() != 0) {
- j++;
- description += " " + nextLine.trim();
- nextLine = lines.get(i + j);
- }
- }
- int openParen = nameAndVersion.indexOf('(');
- int closeParen = nameAndVersion.indexOf(')');
- String name = nameAndVersion.substring(0, openParen);
- String version = nameAndVersion
- .substring(openParen + 1, closeParen);
- gems.add(new Gem(name.trim(), version, description.trim()));
- i += (j + 1);
- } catch (RuntimeException e) {
- AptanaRDTPlugin.log(new IllegalStateException("Was unable to parse local gems correctly from: " + lines.toString()));
- AptanaRDTPlugin.log(e);
- }
- }
- return gems;
- }
-
/*
* (non-Javadoc)
*
@@ -406,9 +377,9 @@
IRubyLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE_SPECIFIC_ATTRS_MAP,
map);
wc.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
+ wc.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND,
+ !interactive);
if (!interactive) {
- wc.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND,
- true);
wc.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE,
false);
IPath outFilePath = AptanaRDTPlugin.getDefault()
@@ -503,8 +474,8 @@
public boolean refresh() {
Set<Gem> newGems = loadLocalGems();
if (!newGems.isEmpty()) {
- gems.clear();
gems = newGems;
+ storeGemCache(gems, getConfigFile(LOCAL_GEMS_CACHE_FILE));
for (GemListener listener : listeners) {
listener.gemsRefreshed();
}
@@ -629,4 +600,15 @@
public IPath getGemPath(String gemName, String version) {
return getGemPath(gemName + "-" + version);
}
+
+ public boolean updateAll() {
+ try {
+ ILaunchConfiguration config = createGemLaunchConfiguration(UPDATE_COMMAND, true);
+ config.launch(ILaunchManager.RUN_MODE, null);
+ } catch (CoreException e) {
+ AptanaRDTPlugin.log(e);
+ return false;
+ }
+ return true;
+ }
}
Added: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.java (rev 0)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemParser.java 2007-06-19 14:27:41 UTC (rev 2630)
@@ -0,0 +1,59 @@
+package com.aptana.rdt.internal.core.gems;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import com.aptana.rdt.AptanaRDTPlugin;
+import com.aptana.rdt.core.gems.Gem;
+
+public class GemParser {
+
+ public Set<Gem> parse(String string) {
+ String[] raw = string.split("\n");
+ List<String> lines = new ArrayList<String>();
+ for (int i = 0; i < raw.length; i++) {
+ lines.add(raw[i]);
+ }
+ if (lines.size() > 2) {
+ lines.remove(0); // Remove first 3 lines from local list
+ lines.remove(0);
+ lines.remove(0);
+ }
+ return parseOutGems(lines);
+ }
+
+ public Set<Gem> parseOutGems(List<String> lines) {
+ Set<Gem> gems = new HashSet<Gem>();
+ for (int i = 0; i < lines.size();) {
+ try {
+ String nameAndVersion = lines.get(i);
+ String description = "";
+ if ((i + 1) < lines.size()) {
+ description = lines.get(i + 1);
+ }
+ int j = 2;
+ while (true) {
+ if ((i + j) >= lines.size()) break; // if there is no next line, break out
+ String nextLine = lines.get(i + j);
+ if (nextLine.trim().length() == 0) break; // if line is empty, break out
+ description += " " + nextLine.trim(); // add line to description
+ j++; // move to next line
+ }
+ int openParen = nameAndVersion.indexOf('(');
+ int closeParen = nameAndVersion.indexOf(')');
+ String name = nameAndVersion.substring(0, openParen);
+ String version = nameAndVersion
+ .substring(openParen + 1, closeParen);
+ gems.add(new Gem(name.trim(), version, description.trim()));
+ i += (j + 1);
+ } catch (RuntimeException e) {
+ AptanaRDTPlugin.log(new IllegalStateException("Was unable to parse local gems correctly from: " + lines.toString()));
+ AptanaRDTPlugin.log(e);
+ }
+ }
+ return gems;
+ }
+
+}
Added: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/ui/actions/UpdateAllActionDelegate.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/ui/actions/UpdateAllActionDelegate.java (rev 0)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/ui/actions/UpdateAllActionDelegate.java 2007-06-19 14:27:41 UTC (rev 2630)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2005 RadRails.org and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package com.aptana.rdt.internal.ui.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
+
+import com.aptana.rdt.internal.core.gems.GemManager;
+
+/**
+ * Install a gem
+ *
+ * @author cwilliams
+ */
+public class UpdateAllActionDelegate implements IObjectActionDelegate, IViewActionDelegate {
+
+
+ /**
+ * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
+ * org.eclipse.ui.IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+
+ }
+
+ /**
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ GemManager.getInstance().updateAll();
+ }
+
+ });
+ }
+
+ /**
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+
+ }
+
+ /**
+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
+ */
+ public void init(IViewPart view) {
+ }
+
+}
Modified: trunk/com.aptana.rdt.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/com.aptana.rdt.tests/META-INF/MANIFEST.MF 2007-06-19 14:13:40 UTC (rev 2629)
+++ trunk/com.aptana.rdt.tests/META-INF/MANIFEST.MF 2007-06-19 14:27:41 UTC (rev 2630)
@@ -11,3 +11,5 @@
org.eclipse.core.runtime,
org.junit
Bundle-Vendor: Aptana, Inc.
+Bundle-Activator: com.aptana.rdt.AptanaRDTTests
+Eclipse-LazyStart: true
Added: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/AptanaRDTTests.java
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/AptanaRDTTests.java (rev 0)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/AptanaRDTTests.java 2007-06-19 14:27:41 UTC (rev 2630)
@@ -0,0 +1,45 @@
+package com.aptana.rdt;
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Plugin;
+
+
+public class AptanaRDTTests extends Plugin {
+
+ // The shared instance
+ private static AptanaRDTTests plugin;
+
+ /**
+ * The constructor
+ */
+ public AptanaRDTTests() {
+ super();
+ plugin = this;
+ }
+
+ 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;
+ }
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static AptanaRDTTests getDefault() {
+ return plugin;
+ }
+
+
+}
Added: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java (rev 0)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/GemParserTest.java 2007-06-19 14:27:41 UTC (rev 2630)
@@ -0,0 +1,54 @@
+package com.aptana.rdt.internal.core.gems;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.Path;
+
+import com.aptana.rdt.AptanaRDTTests;
+import com.aptana.rdt.core.gems.Gem;
+
+public class GemParserTest extends TestCase {
+
+ public void testParsingLocalGems() {
+ GemParser parser = new GemParser();
+ String contents = getContents("src/com/aptana/rdt/internal/core/gems/local.txt");
+ Set<Gem> gems = parser.parse(contents);
+ assertEquals(31, gems.size());
+ }
+
+ private String getContents(String path) {
+ File file = AptanaRDTTests.getFileInPlugin(new Path(path));
+ BufferedReader reader = null;
+ StringBuffer buffer;
+ try {
+ reader = new BufferedReader(new FileReader(file));
+ String line = null;
+ buffer = new StringBuffer();
+ while((line = reader.readLine()) != null) {
+ buffer.append(line);
+ buffer.append("\n");
+ }
+ buffer.deleteCharAt(buffer.length() - 1); // delete last newline
+ return buffer.toString();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ if (reader != null) reader.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ return null;
+ }
+
+}
Added: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/local.txt
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/local.txt (rev 0)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/gems/local.txt 2007-06-19 14:27:41 UTC (rev 2630)
@@ -0,0 +1,100 @@
+
+*** LOCAL GEMS ***
+
+actionmailer (1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.5, 1.2.4)
+ Service layer for easy email delivery and testing.
+
+actionpack (1.13.3, 1.13.2, 1.13.1, 1.13.0, 1.12.5, 1.12.4)
+ Web-flow and rendering framework putting the VC in MVC.
+
+actionwebservice (1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 0.9.4)
+ Web service support for Action Pack.
+
+activerecord (1.15.3, 1.15.2, 1.15.1, 1.15.0, 1.14.4)
+ Implements the ActiveRecord pattern for ORM.
+
+activesupport (1.4.2, 1.4.1, 1.4.0, 1.3.1)
+ Support and utility classes used by the Rails framework.
+
+cgi_multipart_eof_fix (2.1)
+ Fix an exploitable bug in CGI multipart parsing which affects Ruby
+ <= 1.8.5 when multipart boundary attribute contains a non-halting
+ regular expression string.
+
+fastercsv (1.2.0)
+ FasterCSV is CSV, but faster, smaller, and cleaner.
+
+fxri (0.3.6)
+ Graphical interface to the RI documentation, with search engine.
+
+fxruby (1.6.11, 1.6.6)
+ FXRuby is the Ruby binding to the FOX GUI toolkit.
+
+gem_plugin (0.2.2)
+ A plugin system based only on rubygems that uses dependencies only
+
+hpricot (0.6, 0.4)
+ a swift, liberal HTML parser with a fantastic library
+
+log4r (1.0.5)
+ Log4r is a comprehensive and flexible logging library for Ruby.
+
+mongrel (1.0.1)
+ A small fast HTTP library and server that runs Rails, Camping, Nitro
+ and Iowa apps.
+
+rails (1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5)
+ Web-application framework with template engine, control-flow layer,
+ and ORM.
+
+rake (0.7.3, 0.7.2)
+ Ruby based make-like utility.
+
+rspec (1.0.5, 0.9.4)
+ RSpec-1.0.5 (r2081) - BDD for Ruby http://rspec.rubyforge.org/
+
+ruby-debug (0.9.3, 0.9.2)
+ Command line interface (CLI) for ruby-debug-base
+
+ruby-debug-base (0.9.3, 0.9.2)
+ Fast Ruby debugger
+
+ruby-debug-ide (0.1.6, 0.1.4, 0.1.2)
+ IDE interface for ruby-debug.
+
+sources (0.0.1)
+ This package provides download sources for remote gem installation
+
+sqlite3-ruby (1.2.1)
+ SQLite3/Ruby is a module to allow Ruby scripts to interface with a
+ SQLite database.
+
+tzinfo (0.3.3)
+ Daylight-savings aware timezone library
+
+win32-clipboard (0.4.2, 0.4.1)
+ A package for interacting with the Windows clipboard
+
+win32-dir (0.3.1)
+ Extra constants and methods for the Dir class on Windows.
+
+win32-eventlog (0.4.3)
+ Interface for the MS Windows Event Log.
+
+win32-file (0.5.4, 0.5.3)
+ Extra or redefined methods for the File class on Windows.
+
+win32-file-stat (1.2.5, 1.2.3)
+ A File::Stat class tailored to MS Windows
+
+win32-process (0.5.2, 0.5.1)
+ Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method
+
+win32-sapi (0.1.3)
+ An interface to the MS SAPI (Sound API) library.
+
+win32-sound (0.4.0)
+ A package for playing with sound on Windows.
+
+windows-pr (0.6.6, 0.6.2)
+ Windows functions and constants predefined via Win32API
\ 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-06-19 14:13:41
|
Revision: 2629
http://svn.sourceforge.net/rubyeclipse/?rev=2629&view=rev
Author: cawilliams
Date: 2007-06-19 07:13:40 -0700 (Tue, 19 Jun 2007)
Log Message:
-----------
order versions properly (taking them as numbers into account, rather than just treating them as strings)
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/LogicalGem.java
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/LogicalGem.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/LogicalGem.java 2007-06-19 13:19:10 UTC (rev 2628)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/LogicalGem.java 2007-06-19 14:13:40 UTC (rev 2629)
@@ -1,6 +1,9 @@
package com.aptana.rdt.internal.core.gems;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.Comparator;
+import java.util.List;
import java.util.SortedSet;
import java.util.StringTokenizer;
import java.util.TreeSet;
@@ -31,12 +34,40 @@
public SortedSet<String> getVersions() {
String raw = getVersion().substring(1, getVersion().length() - 1);
- SortedSet<String> version = new TreeSet<String>();
+ SortedSet<String> version = new TreeSet<String>(new VersionComparator());
StringTokenizer tokenizer = new StringTokenizer(raw, ",");
while (tokenizer.hasMoreTokens()) {
version.add(tokenizer.nextToken().trim());
}
return version;
}
+
+ private class VersionComparator implements Comparator {
+ public int compare(Object o1, Object o2) {
+ String v1 = (String) o1;
+ String v2 = (String) o2;
+
+ List<Integer> v1Parts = getParts(v1);
+ List<Integer> v2Parts = getParts(v2);
+ for (int i = 0; i <= 3; i++) {
+ Integer one = v1Parts.get(i);
+ Integer two = v2Parts.get(i);
+ int result = one.compareTo(two);
+ if (result != 0) return result;
+ }
+ return 0;
+ }
+
+ private List<Integer> getParts(String version) {
+ StringTokenizer tokenizer = new StringTokenizer(version, ".");
+ List<Integer> parts = new ArrayList<Integer>();
+ while (tokenizer.hasMoreTokens()) {
+ parts.add(Integer.parseInt(tokenizer.nextToken()));
+ }
+ return parts;
+ }
+
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-19 13:19:12
|
Revision: 2628
http://svn.sourceforge.net/rubyeclipse/?rev=2628&view=rev
Author: cawilliams
Date: 2007-06-19 06:19:10 -0700 (Tue, 19 Jun 2007)
Log Message:
-----------
add missing require 'yaml' from Martin's patch
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb
Modified: trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb
===================================================================
--- trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb 2007-06-19 13:00:15 UTC (rev 2627)
+++ trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb 2007-06-19 13:19:10 UTC (rev 2628)
@@ -2,6 +2,7 @@
# Copyright (C) 2000 Information-technology Promotion Agency, Japan
require 'cgi'
require 'thread'
+require 'yaml'
# REMOTE_DEBUG_PORT is the port on which the debugger waits for commands from a
# front-end.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-19 13:00:19
|
Revision: 2627
http://svn.sourceforge.net/rubyeclipse/?rev=2627&view=rev
Author: cawilliams
Date: 2007-06-19 06:00:15 -0700 (Tue, 19 Jun 2007)
Log Message:
-----------
add (failing) test for a case where parentheses probably shouldn't be fixed width
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/FormatTestData.xml
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/FormatTestData.xml
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/FormatTestData.xml 2007-06-19 12:58:57 UTC (rev 2626)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/FormatTestData.xml 2007-06-19 13:00:15 UTC (rev 2627)
@@ -676,5 +676,23 @@
</part>
</test>
+<test ID="LineStartingWithParen">
+<part>
+<assertionMessage>Align line starting with paren</assertionMessage>
+<unformatted>
+class A
+ foo
+ (1 - 2).inspect
+end
+</unformatted>
+<formatted>
+class A
+ foo
+ (1 - 2).inspect
+end
+</formatted>
+</part>
+</test>
+
</tests>
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java 2007-06-19 12:58:57 UTC (rev 2626)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java 2007-06-19 13:00:15 UTC (rev 2627)
@@ -136,4 +136,8 @@
doTest("RescueModifier");
}
+ public void testParen() {
+ doTest("LineStartingWithParen");
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-19 12:59:04
|
Revision: 2626
http://svn.sourceforge.net/rubyeclipse/?rev=2626&view=rev
Author: cawilliams
Date: 2007-06-19 05:58:57 -0700 (Tue, 19 Jun 2007)
Log Message:
-----------
apply patch from martin for classic debugger (don't send binary data over the wire):
http://www.netbeans.org/nonav/issues/show_bug.cgi?id=101748
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb
Modified: trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb
===================================================================
--- trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb 2007-06-19 02:26:36 UTC (rev 2625)
+++ trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb 2007-06-19 12:58:57 UTC (rev 2626)
@@ -76,6 +76,7 @@
valueString.slice!(1..(valueString.length)-2)
end
end
+ valueString = "[Binary Data]" if valueString.is_binary_data?
out("<variable name=\"%s\" kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\"/>", CGI.escapeHTML(name), kind, CGI.escapeHTML(valueString), value.class(), hasChildren, value.respond_to?(:object_id) ? value.object_id : value.id)
end
@@ -1101,7 +1102,7 @@
sleep(1.0) # workaround for large files with ruby 1.6.8, otherwise parse exceptions
loop do
sleep(0.1)
- newData, x, y = IO.select( [socket], nil, nil, 0.001 )
+ newData, _, _ = IO.select( [socket], nil, nil, 0.001 )
next unless newData
DEBUGGER__.traceOff()
input = newData[0].gets.chomp!
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-19 02:26:37
|
Revision: 2625
http://svn.sourceforge.net/rubyeclipse/?rev=2625&view=rev
Author: cawilliams
Date: 2007-06-18 19:26:36 -0700 (Mon, 18 Jun 2007)
Log Message:
-----------
use rubyeclipse.svn.sourceforge.net instead of svn.sourceforge.net
Modified Paths:
--------------
trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config
Modified: trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config
===================================================================
--- trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config 2007-06-18 20:07:36 UTC (rev 2624)
+++ trunk/org.rubypeople.rdt.pluginbuilder/pluginbuilder.config 2007-06-19 02:26:36 UTC (rev 2625)
@@ -7,6 +7,6 @@
pluginbuilder.is.svn=true
autotestsuite.class.inclusions=.*
pluginbuilder.is.runtests=true
-pluginbuilder.svn.url=https\://svn.sourceforge.net/svnroot/rubyeclipse/trunk
+pluginbuilder.svn.url=https\://rubyeclipse.svn.sourceforge.net/svnroot/rubyeclipse/trunk
autotestsuite.plugin.inclusions=.*(test|tests)$
pluginbuilder.is.cvs=false
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-18 20:07:37
|
Revision: 2624
http://svn.sourceforge.net/rubyeclipse/?rev=2624&view=rev
Author: cawilliams
Date: 2007-06-18 13:07:36 -0700 (Mon, 18 Jun 2007)
Log Message:
-----------
handle case where getNextCase() on CaseNode returns something other than a WhenNode
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/TooManyBranchesVisitor.java
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/TooManyBranchesVisitor.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/TooManyBranchesVisitor.java 2007-06-18 20:07:09 UTC (rev 2623)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/TooManyBranchesVisitor.java 2007-06-18 20:07:36 UTC (rev 2624)
@@ -6,6 +6,8 @@
import org.jruby.ast.DefnNode;
import org.jruby.ast.DefsNode;
import org.jruby.ast.IfNode;
+import org.jruby.ast.NewlineNode;
+import org.jruby.ast.Node;
import org.jruby.ast.WhenNode;
import org.jruby.evaluator.Instruction;
import org.rubypeople.rdt.internal.core.parser.warnings.RubyLintVisitor;
@@ -70,7 +72,12 @@
WhenNode when = (WhenNode) iVisited.getFirstWhenNode();
while (when != null) {
branchCount++;
- when = (WhenNode) when.getNextCase();
+ Node thing = when.getNextCase();
+ if (thing instanceof WhenNode) {
+ when = (WhenNode) when.getNextCase();
+ } else {
+ when = null;
+ }
}
return super.visitCaseNode(iVisited);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-06-18 20:07:10
|
Revision: 2623
http://svn.sourceforge.net/rubyeclipse/?rev=2623&view=rev
Author: cawilliams
Date: 2007-06-18 13:07:09 -0700 (Mon, 18 Jun 2007)
Log Message:
-----------
handle locals defined in top-level
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/TooManyLocalsVisitor.java
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/TooManyLocalsVisitor.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/TooManyLocalsVisitor.java 2007-06-15 15:24:00 UTC (rev 2622)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/TooManyLocalsVisitor.java 2007-06-18 20:07:09 UTC (rev 2623)
@@ -7,6 +7,7 @@
import org.jruby.ast.DefnNode;
import org.jruby.ast.DefsNode;
import org.jruby.ast.LocalAsgnNode;
+import org.jruby.ast.RootNode;
import org.jruby.evaluator.Instruction;
import org.rubypeople.rdt.internal.core.parser.warnings.RubyLintVisitor;
@@ -40,6 +41,15 @@
protected String getOptionKey() {
return AptanaRDTPlugin.COMPILER_PB_MAX_LOCALS;
}
+
+ @Override
+ public Instruction visitRootNode(RootNode iVisited) {
+ locals = new HashSet(); // FIXME Keep a scoped stack of locals?!
+ Instruction ins = super.visitRootNode(iVisited);
+ locals.clear();
+ return ins;
+ }
+
@Override
public Instruction visitDefsNode(DefsNode iVisited) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|