View Javadoc

    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;
    8   import java.io.FilenameFilter;
    9
    10  public class RubyLanguage implements Language {
    11
    12      public static class RubyFileOrDirectoryFilter implements FilenameFilter {
    13          public boolean accept(File dir, String filename) {
    14              return filename.endsWith("rb") || filename.endsWith("cgi") ||
    15                      filename.endsWith("class") ||
    16                      (new File(dir.getAbsolutePath() + System.getProperty("file.separator") + filename).isDirectory());
    17          }
    18      }
    19
    20      public Tokenizer getTokenizer() {
    21          return new RubyTokenizer();
    22      }
    23
    24      public FilenameFilter getFileFilter() {
    25          return new RubyFileOrDirectoryFilter();
    26      }
    27  }