Sha256: 4205c5c5ca3b3048621958565c3c429fcece389dbdb6794bacdedd036291dfb5
Contents?: true
Size: 555 Bytes
Versions: 5
Compression:
Stored size: 555 Bytes
Contents
# frozen_string_literal: true module Git module Lint module Validators class Capitalization DEFAULT_PATTERN = /\A[[:upper:]].*\Z/ 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 } private attr_reader :text, :delimiter, :pattern def parts = text.split(delimiter) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems