class S3Deployer::Color

Public Class Methods

green(text) click to toggle source
# File lib/s3_deployer/color.rb, line 4
def green(text)
  self.new(32).wrap(text)
end
new(color) click to toggle source
# File lib/s3_deployer/color.rb, line 17
def initialize(color)
  @color = color
end
red(text) click to toggle source
# File lib/s3_deployer/color.rb, line 12
def red(text)
  self.new(31).wrap(text)
end
yellow(text) click to toggle source
# File lib/s3_deployer/color.rb, line 8
def yellow(text)
  self.new(33).wrap(text)
end

Public Instance Methods

wrap(text) click to toggle source
# File lib/s3_deployer/color.rb, line 21
def wrap(text)
  "\e[#{@color}m#{text}\e[0m"
end