debian-mirror-gitlab/lib/gitlab/ci/config/entry/includes.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
767 B
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
module Gitlab
module Ci
class Config
module Entry
##
# Entry that represents a list of include.
#
2023-07-07 10:43:13 +05:30
class Includes < ::Gitlab::Config::Entry::ComposableArray
2019-07-07 11:18:12 +05:30
include ::Gitlab::Config::Entry::Validatable
validations do
validates :config, array_or_string: true
2020-03-13 15:44:24 +05:30
validate do
next unless opt(:max_size)
next unless config.is_a?(Array)
if config.size > opt(:max_size)
errors.add(:config, "is too long (maximum is #{opt(:max_size)})")
end
end
2019-07-07 11:18:12 +05:30
end
2023-07-07 10:43:13 +05:30
def composable_class
Entry::Include
2019-07-07 11:18:12 +05:30
end
end
end
end
end
end