Module: Bri::Templates::Helpers

Included in:
Cocoadex::Element
Defined in:
lib/ext/template_helpers.rb

Class Method Summary collapse

Class Method Details

.h3(text) ⇒ Object



8
9
10
# File 'lib/ext/template_helpers.rb', line 8

def h3 text
  Term::ANSIColor::blue + text + Term::ANSIColor::reset + "\n"
end

.inline_title(title, value, alignment = 0) ⇒ Object



12
13
14
15
16
# File 'lib/ext/template_helpers.rb', line 12

def inline_title title, value, alignment=0
  length = alignment - title.length
  buffer = length > 0 ? " "*length : ""
  Term::ANSIColor::bold + title + ": " + Term::ANSIColor::reset + "#{buffer}#{value}\n"
end

.wrap(text) ⇒ Object



4
5
6
# File 'lib/ext/template_helpers.rb', line 4

def wrap text
  Bri::Renderer.wrap_row(text, Cocoadex.width)
end