Sha256: 7952da366969d271c595c469da25d0821f52303123694a3453acc98323e4cd57
Contents?: true
Size: 601 Bytes
Versions: 7
Compression:
Stored size: 601 Bytes
Contents
# frozen_string_literal: true module Git module Lint module Validators class Capitalization DEFAULT_PATTERN = /\A[[:upper:]].*\Z/.freeze def initialize text, delimiter: Name::DEFAULT_DELIMITER, pattern: DEFAULT_PATTERN @text = String text @delimiter = delimiter @pattern = pattern end def valid? parts.all? { |name| String(name).match? pattern } end private attr_reader :text, :delimiter, :pattern def parts text.split delimiter end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems