KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > pmd > cpd > RubyLanguage


1 /**
2  * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3  * @authors: Zev Blut zb@ubit.com
4  */

5 package net.sourceforge.pmd.cpd;
6
7 import java.io.File JavaDoc;
8 import java.io.FilenameFilter JavaDoc;
9
10 public class RubyLanguage implements Language {
11
12     public static class RubyFileOrDirectoryFilter implements FilenameFilter JavaDoc {
13         public boolean accept(File JavaDoc dir, String JavaDoc filename) {
14             return filename.endsWith("rb") || filename.endsWith("cgi") ||
15                     filename.endsWith("class") ||
16                     (new File JavaDoc(dir.getAbsolutePath() + fileSeparator + filename).isDirectory());
17         }
18     }
19
20     public Tokenizer getTokenizer() {
21         return new RubyTokenizer();
22     }
23
24     public FilenameFilter JavaDoc getFileFilter() {
25         return new RubyFileOrDirectoryFilter();
26     }
27 }
28
Popular Tags