Class: Gitlab::Ci::Build::Rules::Rule::Clause::Exists
- Inherits:
-
Gitlab::Ci::Build::Rules::Rule::Clause
- Object
- Gitlab::Ci::Build::Rules::Rule::Clause
- Gitlab::Ci::Build::Rules::Rule::Clause::Exists
- Defined in:
- lib/gitlab/ci/build/rules/rule/clause/exists.rb
Constant Summary collapse
- MAX_PATTERN_COMPARISONS =
The maximum number of patterned glob comparisons that will be performed before the rule assumes that it has a match
10_000
Constants inherited from Gitlab::Ci::Build::Rules::Rule::Clause
Instance Method Summary collapse
-
#initialize(globs) ⇒ Exists
constructor
A new instance of Exists.
- #satisfied_by?(_pipeline, context) ⇒ Boolean
Methods inherited from Gitlab::Ci::Build::Rules::Rule::Clause
Constructor Details
#initialize(globs) ⇒ Exists
Returns a new instance of Exists.
11 12 13 14 15 16 |
# File 'lib/gitlab/ci/build/rules/rule/clause/exists.rb', line 11 def initialize(globs) globs = Array(globs) @top_level_only = globs.all?(&method(:top_level_glob?)) @exact_globs, @pattern_globs = globs.partition(&method(:exact_glob?)) end |
Instance Method Details
#satisfied_by?(_pipeline, context) ⇒ Boolean
18 19 20 21 22 |
# File 'lib/gitlab/ci/build/rules/rule/clause/exists.rb', line 18 def satisfied_by?(_pipeline, context) paths = worktree_paths(context) exact_matches?(paths) || pattern_matches?(paths) end |