Class: DeepCover::Reporter::Text
- Defined in:
- lib/deep_cover/reporter/text.rb
Constant Summary collapse
- INDENT =
' '
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
#analysis, #each, #initialize, #populate_stats
Methods included from Memoize
Constructor Details
This class inherits a constructor from DeepCover::Reporter::Base
Class Method Details
Instance Method Details
#report ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/deep_cover/reporter/text.rb', line 9 def report formatted_headings = headings.map.with_index { |h, i| {value: h, alignment: :center} } columns = rows.transpose (1...columns.size).step(2) { |i| columns[i] = formatted_stats(columns[i]) } table = Terminal::Table.new( headings: formatted_headings, rows: columns.transpose, style: {border_bottom: false, border_top: false, alignment: :right}, ) table.align_column 0, :left table.render + "\n\nOverall: #{analysis.overall}%" end |