Sha256: 28e544c40e542af7379d2be7e2ac64c71d134692c3f1b0831eeca766720fb217
Contents?: true
Size: 576 Bytes
Versions: 5
Compression:
Stored size: 576 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? } private attr_reader :text, :delimiter, :minimum def parts = String(text).split(delimiter) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems