lib/simplabs/excellent/checks/class_name_check.rb in excellent-1.7.2 vs lib/simplabs/excellent/checks/class_name_check.rb in excellent-2.0.0

- old
+ new

@@ -14,16 +14,16 @@ # ==== Applies to # # * classes class ClassNameCheck < NameCheck - DEFAULT_PATTERN = /^[A-Z]{1}[a-zA-Z0-9]*$/ - + DEFAULT_PATTERN = '^[A-Z]{1}[a-zA-Z0-9]*$' + def initialize(options = {}) #:nodoc: - pattern = options[:pattern] || DEFAULT_PATTERN - super([Parsing::ClassContext], pattern) + options[:pattern] ||= DEFAULT_PATTERN + super([Parsing::ClassContext], options) end - + protected def warning_args(context) #:nodoc: [context, 'Bad class name {{class}}.', { :class => context.full_name }] end