Sha256: 7a04d3e52ce572890f6bc2ddcb9cd97fd123dd1e3339a4107c5faa8137d4d7d6

Contents?: true

Size: 554 Bytes

Versions: 15

Compression:

Stored size: 554 Bytes

Contents

# frozen_string_literal: true

class Grumlin::QueryValidators::BlocklistedStepsValidator < Grumlin::QueryValidators::Validator
  def initialize(*names)
    super()
    @names = names.to_set
  end

  protected

  def validate(steps, errors)
    (steps.configuration_steps + steps.steps).each do |step|
      if @names.include?(step.name)
        errors[:blocklisted_steps] ||= []
        errors[:blocklisted_steps] << step.name
      end
      step.args.each do |arg|
        validate(arg, errors) if arg.is_a?(Grumlin::Steps)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
grumlin-1.2.0 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.1.0 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.4 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.3 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.3.beta1 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.2 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.1 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.0 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.0.rc7 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.0.rc6 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.0.rc5 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.0.rc4 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.0.rc3 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.0.rc2 lib/grumlin/query_validators/blocklisted_steps_validator.rb
grumlin-1.0.0.rc1 lib/grumlin/query_validators/blocklisted_steps_validator.rb