Class: Rake::Funnel::Support::Timing::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/rake/funnel/support/timing/report.rb

Defined Under Namespace

Classes: Column

Constant Summary collapse

SPACE =
3
HEADER_WIDTH =
70

Instance Method Summary collapse

Constructor Details

#initialize(stats, opts = {}) ⇒ Report

Returns a new instance of Report.



36
37
38
39
# File 'lib/rake/funnel/support/timing/report.rb', line 36

def initialize(stats, opts = {})
  @stats = stats
  @opts = opts
end

Instance Method Details

#columnsObject



47
48
49
50
51
52
# File 'lib/rake/funnel/support/timing/report.rb', line 47

def columns
  @columns ||= ([
    Column.new(stats: @stats, header: 'Target', accessor: -> (timing) { timing[:task].name }),
    Column.new(stats: @stats, header: 'Duration', accessor: -> (timing) { format(timing[:time]) })
  ])
end

#renderObject



41
42
43
44
45
# File 'lib/rake/funnel/support/timing/report.rb', line 41

def render
  header
  rows
  footer
end