|
From: Christopher W. <caw...@us...> - 2005-12-20 20:09:18
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22962/src/org/rubypeople/rdt/internal/core/builder Modified Files: RubySourceFileCollectingVisitor.java Log Message: Don't just check for normal ruby extensions, use content types to determine if we should include a file as ruby source file Index: RubySourceFileCollectingVisitor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubySourceFileCollectingVisitor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RubySourceFileCollectingVisitor.java 16 Oct 2005 17:29:21 -0000 1.1 --- RubySourceFileCollectingVisitor.java 20 Dec 2005 20:09:06 -0000 1.2 *************** *** 14,23 **** --- 14,27 ---- import java.util.List; + import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceProxy; import org.eclipse.core.resources.IResourceProxyVisitor; import org.eclipse.core.runtime.CoreException; + import org.eclipse.core.runtime.content.IContentType; public final class RubySourceFileCollectingVisitor implements IResourceProxyVisitor { + + private static final String RUBY_SOURCE_CONTENT_TYPE_ID = "org.rubypeople.rdt.core.rubySource"; private final List files; *************** *** 34,46 **** files.add(resource); } return false; } return true; } ! public boolean equals(Object obj) { return obj.getClass().equals(getClass()); } ! public int hashCode() { return 0; --- 38,56 ---- files.add(resource); } + // Check for Ruby Source content type + resource = proxy.requestResource(); + IFile file = (IFile) resource; + IContentType type = file.getContentDescription().getContentType(); + if (type == null) return false; + if (type.getId().equals(RUBY_SOURCE_CONTENT_TYPE_ID)) files.add(resource); return false; } return true; } ! public boolean equals(Object obj) { return obj.getClass().equals(getClass()); } ! public int hashCode() { return 0; |