debian-mirror-gitlab/lib/gitlab/ci/build/rules/rule/clause.rb
2022-08-27 11:52:29 +05:30

30 lines
708 B
Ruby

# 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