Class: Gitlab::Verify::RakeTask

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/verify/rake_task.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(verifier, verbose) ⇒ RakeTask

Returns a new instance of RakeTask.


20
21
22
23
# File 'lib/gitlab/verify/rake_task.rb', line 20

def initialize(verifier, verbose)
  @verifier = verifier
  @verbose = verbose
end

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output


18
19
20
# File 'lib/gitlab/verify/rake_task.rb', line 18

def output
  @output
end

#verifierObject (readonly)

Returns the value of attribute verifier


18
19
20
# File 'lib/gitlab/verify/rake_task.rb', line 18

def verifier
  @verifier
end

Class Method Details

.run!(verify_kls) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
# File 'lib/gitlab/verify/rake_task.rb', line 6

def self.run!(verify_kls)
  verifier = verify_kls.new(
    batch_size: ENV.fetch('BATCH', 200).to_i,
    start: ENV['ID_FROM'],
    finish: ENV['ID_TO']
  )

  verbose = Gitlab::Utils.to_boolean(ENV['VERBOSE'])

  new(verifier, verbose).run!
end

Instance Method Details

#run!Object


25
26
27
28
29
30
31
# File 'lib/gitlab/verify/rake_task.rb', line 25

def run!
  say "Checking integrity of #{verifier.name}"

  verifier.run_batches { |*args| run_batch(*args) }

  say 'Done!'
end

#verbose?Boolean

Returns:

  • (Boolean)

33
34
35
# File 'lib/gitlab/verify/rake_task.rb', line 33

def verbose?
  !!@verbose
end