Module: Bri::Templates::Helpers

Included in:
Match::Class, Match::Method
Defined in:
lib/bri/templates.rb

Class Method Summary collapse

Class Method Details

.hrule(text = '', width = Bri.width) ⇒ Object



66
67
68
69
70
71
72
73
# File 'lib/bri/templates.rb', line 66

def hrule( text = '', width = Bri.width )
  if text == ''
    '-' * width + "\n"
  else
    text = " " + text if text != ''
    ( '-' * [ ( width - text.length ), 1 ].max ) + Term::ANSIColor::bold( text ) + "\n"
  end
end

.section_header(text) ⇒ Object



76
77
78
# File 'lib/bri/templates.rb', line 76

def section_header( text )
  Term::ANSIColor::green + Term::ANSIColor::underline + text + Term::ANSIColor::reset + "\n"
end