blob: 503f2a8736114c8f46195e081761987a87cd9f00 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# frozen_string_literal: true
module Gitlab
module Ci
module Build
class Rules::Rule::Clause
##
# Abstract class that defines an interface of a single
# job rule specification.
#
# Used for job's inclusion rules configuration.
#
UnknownClauseError = Class.new(StandardError)
ParseError = Class.new(StandardError)
def self.fabricate(type, value)
"#{self}::#{type.to_s.camelize}".safe_constantize&.new(value)
end
def initialize(spec)
@spec = spec
end
def satisfied_by?(pipeline, context = nil)
raise NotImplementedError
end
end
end
end
end
|