forked from phoedos/pmd
Checkstyle fixes
This commit is contained in:
@ -4,11 +4,16 @@
|
||||
package net.sourceforge.pmd.cpd;
|
||||
|
||||
/**
|
||||
*
|
||||
* Language implemention for Ruby.
|
||||
*
|
||||
* @author Zev Blut zb@ubit.com
|
||||
*/
|
||||
public class RubyLanguage extends AbstractLanguage {
|
||||
public RubyLanguage() {
|
||||
super("Ruby", "ruby", new RubyTokenizer(), ".rb", ".cgi", ".class");
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Ruby Language instance.
|
||||
*/
|
||||
public RubyLanguage() {
|
||||
super("Ruby", "ruby", new RubyTokenizer(), ".rb", ".cgi", ".class");
|
||||
}
|
||||
}
|
||||
|
@ -6,30 +6,33 @@ package net.sourceforge.pmd.cpd;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* Tokenizer for Ruby.
|
||||
*
|
||||
* @author Zev Blut zb@ubit.com
|
||||
*/
|
||||
public class RubyTokenizer extends AbstractTokenizer
|
||||
{
|
||||
public RubyTokenizer()
|
||||
{
|
||||
// setting markers for "string" in ruby
|
||||
this.stringToken = new ArrayList<String>();
|
||||
this.stringToken.add("\'");
|
||||
this.stringToken.add("\"");
|
||||
// setting markers for 'ignorable character' in Ruby
|
||||
this.ignorableCharacter = new ArrayList<String>();
|
||||
this.ignorableCharacter.add("{");
|
||||
this.ignorableCharacter.add("}");
|
||||
this.ignorableCharacter.add("(");
|
||||
this.ignorableCharacter.add(")");
|
||||
this.ignorableCharacter.add(";");
|
||||
this.ignorableCharacter.add(",");
|
||||
public class RubyTokenizer extends AbstractTokenizer {
|
||||
|
||||
// setting markers for 'ignorable string' in Ruby
|
||||
this.ignorableStmt = new ArrayList<String>();
|
||||
this.ignorableStmt.add("while");
|
||||
this.ignorableStmt.add("do");
|
||||
this.ignorableStmt.add("end");
|
||||
/**
|
||||
* Creates a new Ruby tokenizer.
|
||||
*/
|
||||
public RubyTokenizer() {
|
||||
// setting markers for "string" in ruby
|
||||
this.stringToken = new ArrayList<String>();
|
||||
this.stringToken.add("\'");
|
||||
this.stringToken.add("\"");
|
||||
// setting markers for 'ignorable character' in Ruby
|
||||
this.ignorableCharacter = new ArrayList<String>();
|
||||
this.ignorableCharacter.add("{");
|
||||
this.ignorableCharacter.add("}");
|
||||
this.ignorableCharacter.add("(");
|
||||
this.ignorableCharacter.add(")");
|
||||
this.ignorableCharacter.add(";");
|
||||
this.ignorableCharacter.add(",");
|
||||
|
||||
// setting markers for 'ignorable string' in Ruby
|
||||
this.ignorableStmt = new ArrayList<String>();
|
||||
this.ignorableStmt.add("while");
|
||||
this.ignorableStmt.add("do");
|
||||
this.ignorableStmt.add("end");
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +1,25 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
package net.sourceforge.pmd.lang.ruby;
|
||||
|
||||
import net.sourceforge.pmd.lang.BaseLanguageModule;
|
||||
|
||||
/**
|
||||
* Created by christoferdutz on 20.09.14.
|
||||
* Language module for Ruby.
|
||||
*/
|
||||
public class RubyLanguageModule extends BaseLanguageModule {
|
||||
|
||||
/** The name. */
|
||||
public static final String NAME = "Ruby";
|
||||
/** The terse name. */
|
||||
public static final String TERSE_NAME = "ruby";
|
||||
|
||||
/**
|
||||
* Creates a new Ruby Language Module instance.
|
||||
*/
|
||||
public RubyLanguageModule() {
|
||||
super(NAME, null, TERSE_NAME, null, "rb", "cgi", "class");
|
||||
addVersion("", null, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
package net.sourceforge.pmd;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
@ -17,9 +19,8 @@ public class LanguageVersionTest extends AbstractLanguageVersionTest {
|
||||
}
|
||||
|
||||
@Parameters
|
||||
public static Collection data() {
|
||||
return Arrays.asList(new Object[][] {
|
||||
{ RubyLanguageModule.NAME, RubyLanguageModule.TERSE_NAME, "", LanguageRegistry.getLanguage(RubyLanguageModule.NAME).getDefaultVersion() }
|
||||
});
|
||||
public static Collection<Object[]> data() {
|
||||
return Arrays.asList(new Object[][] { { RubyLanguageModule.NAME, RubyLanguageModule.TERSE_NAME, "",
|
||||
LanguageRegistry.getLanguage(RubyLanguageModule.NAME).getDefaultVersion() } });
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user