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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Runner.



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

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

Instance Method Details

#performObject



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

def perform
  run_command do |line|
    @stdout.puts(line) if printable?(line)
    @exit_code = 1 if failed?(line)
  end
  @exit_code
end