Class: Git::Lint::Validators::Capitalization

Inherits:
Object
  • Object
show all
Defined in:
lib/git/lint/validators/capitalization.rb

Overview

Validates the capitalizationn of text.

Constant Summary collapse

PATTERN =
/\A[[:upper:]].*\Z/

Instance Method Summary collapse

Constructor Details

#initialize(delimiter: Name::DELIMITER, pattern: PATTERN) ⇒ Capitalization

Returns a new instance of Capitalization.



10
11
12
13
# File 'lib/git/lint/validators/capitalization.rb', line 10

def initialize delimiter: Name::DELIMITER, pattern: PATTERN
  @delimiter = delimiter
  @pattern = pattern
end

Instance Method Details

#call(content) ⇒ Object



15
# File 'lib/git/lint/validators/capitalization.rb', line 15

def call(content) = String(content).split(delimiter).all? { |name| name.match? pattern }