Sha256: ccff6a3c9412b9298a9258e3747d7417e3fa50f4187c633dacd1251ed3b3b469

Contents?: true

Size: 655 Bytes

Versions: 3

Compression:

Stored size: 655 Bytes

Contents

# frozen_string_literal: true

module NeetoCompliance
  class SidekiqQueuesVerifier < Base
    def local_copy
      "config/sidekiq.yml"
    end

    def queues
      @_queues ||= ["active_storage_analysis", "active_storage_purge"]
    end

    def valid?
      @errors = []

      sidekiq_yml = YAML.load(File.open(local_copy), aliases: true)

      queues.map do |queue|
        unless sidekiq_yml["queues"].include?(queue)
          @errors << "Add #{queue} to queues in #{local_copy}"
        end
      end

      @errors.length == 0
    end

    def autofix_suggestion
      @errors.join("\n").yellow
    end

    def auto_correct!
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
neetob-0.1.2 neeto_compliance/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb
neetob-0.1.1 /Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb
neetob-0.1.0 /Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb