Class: Ralph::Output::Iteration::Summary

Inherits:
Object
  • Object
show all
Extended by:
Helpers
Defined in:
lib/ralph/output/iteration.rb

Class Method Summary collapse

Methods included from Helpers

check_completion, escape_regex, format_duration, format_duration_long, format_tool_summary, now_ms, strip_ansi, which

Class Method Details

.call(loop_context, result) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ralph/output/iteration.rb', line 21

def self.call(loop_context, result)
  tool_summary = format_tool_summary(result.tool_counts)
  puts "\nIteration Summary"
  puts "" * 68
  puts "Iteration: #{loop_context.state.iteration}"
  puts "Elapsed:   #{format_duration(result.duration_ms)}"
  if tool_summary && !tool_summary.empty?
    puts "Tools:     #{tool_summary}"
  else
    puts "Tools:     none"
  end
  puts "Exit code: #{result.exit_code}"
  puts "Completion promise: #{result.completion_detected ? "detected" : "not detected"}"
end