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

20 lines
441 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::If < Rules::Rule::Clause
def initialize(expression)
@expression = expression
end
def satisfied_by?(pipeline, seed)
variables = seed.scoped_variables_hash
::Gitlab::Ci::Pipeline::Expression::Statement.new(@expression, variables).truthful?
end
end
end
end
end