Class: Warder::Runner

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

Overview

abstract class for command runners

Constant Summary collapse

SCORE =
30
FAILURE_THRESHOLD =
0

Instance Method Summary collapse

Constructor Details

#initialize(stdout, options = {}) ⇒ Runner

Returns a new instance of Runner.



7
8
9
10
11
# File 'lib/warder/runner.rb', line 7

def initialize(stdout, options = {})
  @stdout = stdout
  @options = options
  @issues = 0
end

Instance Method Details

#performObject



13
14
15
16
17
18
19
# File 'lib/warder/runner.rb', line 13

def perform
  run_command do |line|
    @issues += number_of_issues(line)
    @stdout.puts(line) if printable?(line)
  end
  @issues > 0 ? 1 : 0
end