Sha256: 967c3359646e17379597577d9257f0a8eda794edbcc7e082cbf4025a32b36459
Contents?: true
Size: 615 Bytes
Versions: 4
Compression:
Stored size: 615 Bytes
Contents
# frozen_string_literal: true module Git module Lint module Validators class Name DEFAULT_DELIMITER = /\s{1}/ DEFAULT_MINIMUM = 2 def initialize text, delimiter: DEFAULT_DELIMITER, minimum: DEFAULT_MINIMUM @text = text @delimiter = delimiter @minimum = minimum end def valid? parts.size >= minimum && parts.all? { |name| !String(name).empty? } end private attr_reader :text, :delimiter, :minimum def parts String(text).split delimiter end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems