Class: Drunker::Aggregator::Pretty

Inherits:
Base
  • Object
show all
Defined in:
lib/drunker/aggregator/pretty.rb

Instance Method Summary collapse

Instance Method Details

#exit_status(layers) ⇒ Object



22
23
24
# File 'lib/drunker/aggregator/pretty.rb', line 22

def exit_status(layers)
  layers.map { |layer| layer.invalid? ? 1 : layer.exit_status }.max
end

#run(layers) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/drunker/aggregator/pretty.rb', line 4

def run(layers)
  layers.each do |layer|
    puts
    puts "-------------------------------------------------------------------------------------------"
    puts "BUILD_ID: #{layer.build_id}"
    if layer.invalid?
      puts "RESULT: FAILED"
    else
      puts "RESULT: SUCCESS"
      puts "STDOUT: #{layer.stdout}"
      puts "STDERR: #{layer.stderr}"
      puts "EXIT_STATUS: #{layer.exit_status}"
    end
    puts "-------------------------------------------------------------------------------------------"
    puts
  end
end