Class: CleoQualityReview::Runner

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

Overview

Orchestrates a complete quality review run

Defined Under Namespace

Classes: AnalysisContext

Instance Method Summary collapse

Constructor Details

#initialize(options:, command_runner: CommandRunner.new, clock: Time, check_registry: Checks) ⇒ Runner

Returns a new instance of Runner.

Parameters:

  • options (Options::ParseResult)

    parsed command-line options

  • command_runner (CommandRunner) (defaults to: CommandRunner.new)

    for executing shell commands

  • clock (#now) (defaults to: Time)

    time source for timestamps

  • check_registry (CheckRegistry) (defaults to: Checks)

    registry for resolving check names



38
39
40
41
42
43
# File 'lib/cleo_quality_review/runner.rb', line 38

def initialize(options:, command_runner: CommandRunner.new, clock: Time, check_registry: Checks)
  @options = options
  @command_runner = command_runner
  @clock = clock
  @check_registry = check_registry
end

Instance Method Details

#runRun

Execute the quality review

Returns:

  • (Run)

    results of the quality review



48
49
50
51
52
53
54
# File 'lib/cleo_quality_review/runner.rb', line 48

def run
  context = analysis_context
  artifacts = prepare_artifacts(context)
  return reusable_run(artifacts) if artifacts.complete?

  execute_fresh_run(context, artifacts)
end