Module: Xmi::Performance::Helpers::Term

Extended by:
Term
Included in:
Term
Defined in:
lib/xmi/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: Helpers::CYAN) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/xmi/performance/helpers.rb', line 36

def header(title, color: Helpers::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



45
46
47
# File 'lib/xmi/performance/helpers.rb', line 45

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