Class: NeetoCompliance::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/neeto_compliance/runner.rb

Instance Method Summary collapse

Instance Method Details

#app_nameObject



39
40
41
# File 'lib/neeto_compliance/runner.rb', line 39

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

#auto_correctObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/neeto_compliance/runner.rb', line 25

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

#processObject



17
18
19
20
21
22
23
# File 'lib/neeto_compliance/runner.rb', line 17

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

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

#verifiersObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/neeto_compliance/runner.rb', line 5

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