Class: Yard::Lint::Runner

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

Overview

Main runner class that orchestrates the YARD validation process

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(selection, config = Config.new) ⇒ Runner

Returns a new instance of Runner.

Parameters:

  • selection (Array<String>)

    array with ruby files to check

  • config (Yard::Lint::Config) (defaults to: Config.new)

    configuration object



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

def initialize(selection, config = Config.new)
  @selection = Array(selection).flatten
  @config = config
  @result_builder = ResultBuilder.new(config)
  @progress_formatter = nil
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



13
14
15
# File 'lib/yard/lint/runner.rb', line 13

def config
  @config
end

#progress_formatterObject

Returns the value of attribute progress_formatter.



14
15
16
# File 'lib/yard/lint/runner.rb', line 14

def progress_formatter
  @progress_formatter
end

#selectionObject (readonly)

Returns the value of attribute selection.



13
14
15
# File 'lib/yard/lint/runner.rb', line 13

def selection
  @selection
end

Instance Method Details

#runYard::Lint::Result

Runs all validators and returns a Result object

Returns:

  • (Yard::Lint::Result)

    result object with all offenses



27
28
29
30
31
# File 'lib/yard/lint/runner.rb', line 27

def run
  raw_results = run_validators
  parsed_results = parse_results(raw_results)
  build_result(parsed_results, @selection)
end