Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/tmb/bundle.rb

Instance Method Summary collapse

Instance Method Details

#boldObject



97
98
99
# File 'lib/tmb/bundle.rb', line 97

def bold
  "\033[1m" + self + "\033[0m"
end

#indent(indent = TM::Indent) ⇒ Object



89
90
91
# File 'lib/tmb/bundle.rb', line 89

def indent(indent=TM::Indent)
  indent + self
end

#text_wrap(width = TM::TextWrap, indent = TM::Indent) ⇒ Object



93
94
95
# File 'lib/tmb/bundle.rb', line 93

def text_wrap(width=TM::TextWrap, indent=TM::Indent)
  self.gsub /(.{1,#{width}})(\s+|\Z)/, "\\1\n".indent(indent)
end