Sha256: 48aac9c718229ff22cb6b0821a24cfaaafdd0301e8da9c64a14bca8999ae7fdf
Contents?: true
Size: 593 Bytes
Versions: 5
Compression:
Stored size: 593 Bytes
Contents
# frozen_string_literal: true require_relative 'expansion' module Gitlab module Triage module ExpandCondition module Sequence PATTERN = /\{\s*(\d+)\s*\.\.\s*(\d+)\s*\}/ def self.expand(conditions) labels = conditions[:labels] return conditions unless labels expansion = Expansion.new(PATTERN) do |(lower, upper)| Integer(lower)..Integer(upper) end expansion.perform(labels).map do |new_labels| conditions.merge(labels: new_labels) end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems