Sha256: c87d33ae7f4a1d88d93df847640768e1aca4ef57cb06032bc7230f78e2fc6751
Contents?: true
Size: 592 Bytes
Versions: 12
Compression:
Stored size: 592 Bytes
Contents
# frozen_string_literal: true require "refinements/strings" module Git module Lint module Validators # Validates the format of names. class Name using Refinements::Strings 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
12 entries across 12 versions & 1 rubygems