Module: PerformanceHelpers::Term

Extended by:
Term
Included in:
Term
Defined in:
lib/tasks/performance_helpers.rb

Overview

Terminal formatting helpers

Constant Summary collapse

HL =
""
VL =
""
TL =
""
TR =
""
BL =
""
BR =
""

Instance Method Summary collapse

Instance Method Details

#header(title, color: PerformanceHelpers::CYAN) ⇒ Object



31
32
33
34
35
36
37
38
# File 'lib/tasks/performance_helpers.rb', line 31

def header(title, color: PerformanceHelpers::CYAN)
  width = 78
  line = HL * width
  puts
  puts "#{color}#{TL}#{line}#{TR}#{CLEAR}"
  puts "#{color}#{VL}#{CLEAR}  #{BOLD}#{color}#{title}#{CLEAR}#{' ' * (width - title.length - 4)}#{color}#{VL}#{CLEAR}"
  puts "#{color}#{BL}#{line}#{BR}#{CLEAR}"
end

#sep(char: HL, width: 78) ⇒ Object



40
41
42
# File 'lib/tasks/performance_helpers.rb', line 40

def sep(char: HL, width: 78)
  puts "#{DIM}#{char * width}#{CLEAR}"
end