class String

Public Instance Methods

bg_black() click to toggle source
# File lib/format.rb, line 33
def bg_black
  return "\e[40m" + self + "\e[49m"
end
bg_yellow() click to toggle source
# File lib/format.rb, line 37
def bg_yellow
  return "\e[43m" + self + "\e[49m"
end
blue() click to toggle source
# File lib/format.rb, line 16
def blue
  return "\e[34m" + self + "\e[39m"
end
bold() click to toggle source
# File lib/format.rb, line 41
def bold
  return "\e[1m" + self + "\e[0m"
end
cyan() click to toggle source
# File lib/format.rb, line 24
def cyan
  return "\e[36m" + self + "\e[39m"
end
fixed_width(width = 64) click to toggle source
# File lib/format.rb, line 2
def fixed_width(width = 64)
  return self + (" " * (width - self.size)) if self.size < width

  self[0, width - 3].chomp + "..."
end
green() click to toggle source
# File lib/format.rb, line 12
def green
  return "\e[32m" + self + "\e[39m"
end
magenta() click to toggle source
# File lib/format.rb, line 20
def magenta
  return "\e[35m" + self + "\e[39m"
end
red() click to toggle source
# File lib/format.rb, line 8
def red
  return "\e[31m" + self + "\e[39m"
end
underline() click to toggle source
# File lib/format.rb, line 45
def underline
  return "\e[4m" + self + "\e[0m"
end
white() click to toggle source
# File lib/format.rb, line 28
def white
  return "\e[37m" + self + "\e[39m"
end