debian-mirror-gitlab/lib/gitlab/ci/config/entry/includes.rb
2019-07-07 11:18:12 +05:30

32 lines
790 B
Ruby

# frozen_string_literal: true
module Gitlab
module Ci
class Config
module Entry
##
# Entry that represents a list of include.
#
class Includes < ::Gitlab::Config::Entry::Node
include ::Gitlab::Config::Entry::Validatable
validations do
validates :config, array_or_string: true
end
def self.aspects
super.append -> do
@config = Array.wrap(@config)
@config.each_with_index do |config, i|
@entries[i] = ::Gitlab::Config::Entry::Factory.new(Entry::Include)
.value(config || {})
.create!
end
end
end
end
end
end
end
end