Class: S3Deployer::Color

Inherits:
Object
  • Object
show all
Defined in:
lib/s3_deployer/color.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(color) ⇒ Color

Returns a new instance of Color.



17
18
19
# File 'lib/s3_deployer/color.rb', line 17

def initialize(color)
  @color = color
end

Class Method Details

.green(text) ⇒ Object



4
5
6
# File 'lib/s3_deployer/color.rb', line 4

def green(text)
  self.new(32).wrap(text)
end

.red(text) ⇒ Object



12
13
14
# File 'lib/s3_deployer/color.rb', line 12

def red(text)
  self.new(31).wrap(text)
end

.yellow(text) ⇒ Object



8
9
10
# File 'lib/s3_deployer/color.rb', line 8

def yellow(text)
  self.new(33).wrap(text)
end

Instance Method Details

#wrap(text) ⇒ Object



21
22
23
# File 'lib/s3_deployer/color.rb', line 21

def wrap(text)
  "\e[#{@color}m#{text}\e[0m"
end