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.16.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.15.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.14.3 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.14.2 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.14.1 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.14.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.13.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.12.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.11.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.10.1 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.10.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.9.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.8.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.7.1 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.7.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.6.1 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.6.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.5.1 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.5.0 lib/gitlab/triage/filters/ruby_conditions_filter.rb
gitlab-triage-1.4.2 lib/gitlab/triage/filters/ruby_conditions_filter.rb