Class: RailsStats::ConsoleFormatter

Inherits:
StatsFormatter show all
Defined in:
lib/rails_stats/console_formatter.rb

Instance Attribute Summary

Attributes inherited from StatsFormatter

#calculator

Instance Method Summary collapse

Methods inherited from StatsFormatter

#initialize

Constructor Details

This class inherits a constructor from RailsStats::StatsFormatter

Instance Method Details

#to_sObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/rails_stats/console_formatter.rb', line 5

def to_s
  Bundler::Stats::CLI.start

  print_header
  sorted_keys = @statistics.keys.sort
  sorted_keys.each { |key| print_line(key, @statistics[key]) }
  print_splitter

  if @grand_total
    print_line("Code", @code_total)
    print_line("Tests", @tests_total)
    print_line("Total", @grand_total)
    print_splitter
  end

  print_code_test_stats
end