Class: Gitlab::Ci::Config::Header::Input::Rules

Inherits:
Gitlab::Config::Entry::ComposableArray show all
Includes:
Gitlab::Config::Entry::Validatable
Defined in:
lib/gitlab/ci/config/header/input/rules.rb,
lib/gitlab/ci/config/header/input/rules/rule.rb

Overview

Input rules define conditional options and defaults based on expressions.

Defined Under Namespace

Classes: Rule

Constant Summary

Constants inherited from Gitlab::Config::Entry::Node

Gitlab::Config::Entry::Node::InvalidError

Instance Attribute Summary

Attributes inherited from Gitlab::Config::Entry::Node

#config, #default, #deprecation, #description, #key, #metadata, #parent

Instance Method Summary collapse

Methods included from Gitlab::Config::Entry::Validatable

#compose!, included, #validate, #validator

Methods inherited from Gitlab::Config::Entry::ComposableArray

#compose!, #descendants, #value

Methods inherited from Gitlab::Config::Entry::Node

#[], #add_warning, #ancestors, #array?, aspects, #compose!, default, #descendants, #hash?, #initialize, #inspect, #integer?, #leaf?, #location, #opt, #relevant?, #specified?, #string?, #valid?, #value, #warnings, with_aspect

Constructor Details

This class inherits a constructor from Gitlab::Config::Entry::Node

Instance Method Details

#composable_classObject



18
19
20
# File 'lib/gitlab/ci/config/header/input/rules.rb', line 18

def composable_class
  Gitlab::Ci::Config::Header::Input::Rules::Rule
end

#errorsObject



22
23
24
25
26
27
28
# File 'lib/gitlab/ci/config/header/input/rules.rb', line 22

def errors
  super.map do |error|
    error.gsub(/(?:header:spec:inputs:)?(\w+):rules:rule (?:base |config )?(.+)/) do
      "`#{::Regexp.last_match(1)}` input: #{::Regexp.last_match(2)}"
    end
  end
end