Sha256: 47921a291600a7e4c875421ff6ff346179df5285a3dcb0f2d55cbb48a894a6a4

Contents?: true

Size: 627 Bytes

Versions: 20

Compression:

Stored size: 627 Bytes

Contents

require_relative '../rule_engine'

class ConfigurationVisitor
  def self.Visit
    configurationsHash = {}

    rules = RuleEngine.rules
    rules.each do |rule|
      configurationsHash[rule] = []
      rule.configurations.each do |configuration|
        configurationsHash[rule].append(configuration)
      end
    end

    return configurationsHash
  end

  def self.GenerateIDs
    configurationsHash = self.Visit

    configurationsHash.each do |rule,configurations|
      configurations.each do |configuration|
        configuration.id = "#{rule}-#{configuration.name.downcase.gsub! ' ', '_'}"
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-sec-lint-1.0.0 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.17 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.16 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.15 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.14 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.13 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.11 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.10 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.9 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.8 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.7 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.6 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.5 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.4 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.3 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.2 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.1 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.5.0 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.1.2 lib/visitors/configuration_visitor.rb
puppet-sec-lint-0.1.1 lib/visitors/configuration_visitor.rb