Sha256: 677ae8ecd433fcf7756f0f4f4ffb29c650d63d2dc8d1a787abe44b78f4880dd0
Contents?: true
Size: 590 Bytes
Versions: 14
Compression:
Stored size: 590 Bytes
Contents
# frozen_string_literal: true require "refinements/string" module Git module Lint module Validators # Validates the format of names. class Name using Refinements::String DELIMITER = /\s{1}/ MINIMUM = 2 def initialize delimiter: DELIMITER @delimiter = delimiter end def call content, minimum: MINIMUM parts = String(content).split delimiter parts.size >= minimum && parts.all? { |name| !name.blank? } end private attr_reader :delimiter end end end end
Version data entries
14 entries across 14 versions & 1 rubygems