Sha256: 91e7a810bfe0303f4e2d2cadd25486d6b6912d6c3e2fc91c77d4689444cd4557

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

module NeetoCompliance
  class Runner
    def verifiers
      if app_name == "neeto-auth-web"
        VerifiersList.neeto_auth
      elsif NeetoCompliance::NeetoRepos.nanos_backend.include?(app_name)
        VerifiersList.neeto_gems
      elsif NeetoCompliance::NeetoRepos.nanos_mono_repos.include?(app_name)
        VerifiersList.neeto_gems
      else
        VerifiersList.neeto_apps
      end
    end

    def process
      results = verifiers.map do |verifier|
        verifier.new.process
      end

      results.all? ? exit(0) : exit(1)
    end

    def auto_correct
      puts "Running auto_correct ...".yellow
      results = verifiers.map do |verifier|
        verifier.new.auto_correct!
      end

      puts %(
        Auto fixing got completed \n
        Please run bundle exec neeto-audit once again to fix other errors manually if any \n
      ).yellow

      results.all? ? exit(0) : exit(1)
    end

    def app_name
      @_app_name ||= `git config --get remote.origin.url`.split("/").last.strip.split(".git").first
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
neeto-compliance-1.0.58 lib/neeto_compliance/runner.rb