debian-mirror-gitlab/lib/gitlab/ci/build/rules/rule/clause.rb

30 lines
662 B
Ruby
Raw Normal View History

2019-12-04 20:38:33 +05: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)
def self.fabricate(type, value)
"#{self}::#{type.to_s.camelize}".safe_constantize&.new(value)
end
def initialize(spec)
@spec = spec
end
2019-12-26 22:10:19 +05:30
def satisfied_by?(pipeline, context = nil)
2019-12-04 20:38:33 +05:30
raise NotImplementedError
end
end
end
end
end