Module: XcodeBuild::Utilities::Colorize
- Included in:
- Formatters::ProgressFormatter
- Defined in:
- lib/xcode_build/utilities/colorize.rb
Overview
borrowed from rspec-core
Instance Method Summary collapse
- #blue(text) ⇒ Object
- #bold(text) ⇒ Object
- #color(text, color_code) ⇒ Object
- #cyan(text) ⇒ Object
- #green(text) ⇒ Object
- #magenta(text) ⇒ Object
- #red(text) ⇒ Object
- #short_padding ⇒ Object
- #white(text) ⇒ Object
- #yellow(text) ⇒ Object
Instance Method Details
#blue(text) ⇒ Object
24 25 26 |
# File 'lib/xcode_build/utilities/colorize.rb', line 24 def blue(text) color(text, "\e[34m") end |
#bold(text) ⇒ Object
8 9 10 |
# File 'lib/xcode_build/utilities/colorize.rb', line 8 def bold(text) color(text, "\e[1m") end |
#color(text, color_code) ⇒ Object
4 5 6 |
# File 'lib/xcode_build/utilities/colorize.rb', line 4 def color(text, color_code) color_enabled? ? "#{color_code}#{text}\e[0m" : text end |
#cyan(text) ⇒ Object
32 33 34 |
# File 'lib/xcode_build/utilities/colorize.rb', line 32 def cyan(text) color(text, "\e[36m") end |
#green(text) ⇒ Object
16 17 18 |
# File 'lib/xcode_build/utilities/colorize.rb', line 16 def green(text) color(text, "\e[32m") end |
#magenta(text) ⇒ Object
28 29 30 |
# File 'lib/xcode_build/utilities/colorize.rb', line 28 def magenta(text) color(text, "\e[35m") end |
#red(text) ⇒ Object
12 13 14 |
# File 'lib/xcode_build/utilities/colorize.rb', line 12 def red(text) color(text, "\e[31m") end |
#short_padding ⇒ Object
40 41 42 |
# File 'lib/xcode_build/utilities/colorize.rb', line 40 def short_padding ' ' end |
#white(text) ⇒ Object
36 37 38 |
# File 'lib/xcode_build/utilities/colorize.rb', line 36 def white(text) color(text, "\e[37m") end |
#yellow(text) ⇒ Object
20 21 22 |
# File 'lib/xcode_build/utilities/colorize.rb', line 20 def yellow(text) color(text, "\e[33m") end |