Sha256: ca57617f66bc773f90d58977b3990b888273d30c6f0464718bec31a10e298f77

Contents?: true

Size: 751 Bytes

Versions: 44

Compression:

Stored size: 751 Bytes

Contents

require_relative 'base_conditions_filter'
require_relative '../resource/context'
require 'date'

module Gitlab
  module Triage
    module Filters
      class RubyConditionsFilter < BaseConditionsFilter
        def self.limiter_parameters
          [{ name: :ruby, type: String }]
        end

        def initialize(resource, condition, network = nil)
          super(resource, condition)

          @network = network
        end

        def calculate
          context = Resource::Context.build(@resource, network: @network, redact_confidentials: false)

          !!context.eval(@expression)
        end

        private

        def initialize_variables(condition)
          @expression = condition[:ruby]
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
gitlab-triage-1.41.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.40.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.30.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.29.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
payping-gitlab-triage-0.1.3 lib/gitlab/triage/filters/ruby_conditions_filter.rb
payping-gitlab-triage-0.1.2 lib/gitlab/triage/filters/ruby_conditions_filter.rb
payping-gitlab-triage-0.1.1 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.28.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.27.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.26.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.25.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.24.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.23.1 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.23.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.22.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.21.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.20.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.19.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.18.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.17.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb