Sha256: 21cb038bb58089df203415dfb258cbaa3d2008ca3743f456f45a61759a6cbd39
Contents?: true
Size: 518 Bytes
Versions: 27
Compression:
Stored size: 518 Bytes
Contents
# frozen_string_literal: true module Git module Lint module Validators # Validates the capitalizationn of text. class Capitalization PATTERN = /\A[[:upper:]].*\Z/ def initialize delimiter: Name::DELIMITER, pattern: PATTERN @delimiter = delimiter @pattern = pattern end def call(content) = String(content).split(delimiter).all? { |name| name.match? pattern } private attr_reader :delimiter, :pattern end end end end
Version data entries
27 entries across 27 versions & 1 rubygems