Module: Megatest::Output::ANSIColors

Extended by:
ANSIColors
Included in:
ANSIColors
Defined in:
lib/megatest/output.rb

Instance Method Summary collapse

Instance Method Details

#blue(text) ⇒ Object



26
27
28
# File 'lib/megatest/output.rb', line 26

def blue(text)
  colorize(text, 34)
end

#cyan(text) ⇒ Object



34
35
36
# File 'lib/megatest/output.rb', line 34

def cyan(text)
  colorize(text, 36)
end

#green(text) ⇒ Object



18
19
20
# File 'lib/megatest/output.rb', line 18

def green(text)
  colorize(text, 32)
end

#grey(text) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/megatest/output.rb', line 38

def grey(text)
  # TODO: somehow grey is invisible on my terminal (Terminal.app, Pro theme)
  # Grey for unchanged lines in diff seems like a great idea, but need to figure out
  # when it's safe to use.
  # colorize(text, 8)
  text
end

#magenta(text) ⇒ Object



30
31
32
# File 'lib/megatest/output.rb', line 30

def magenta(text)
  colorize(text, 35)
end

#red(text) ⇒ Object



14
15
16
# File 'lib/megatest/output.rb', line 14

def red(text)
  colorize(text, 31)
end

#strip(text) ⇒ Object



10
11
12
# File 'lib/megatest/output.rb', line 10

def strip(text)
  text.gsub(/\e\[(\d+(;\d+)?)?m/, "")
end

#yellow(text) ⇒ Object



22
23
24
# File 'lib/megatest/output.rb', line 22

def yellow(text)
  colorize(text, 33)
end