Module: HealthInspector::Color
- Included in:
- HealthInspector::Checklists::Base
- Defined in:
- lib/health_inspector/color.rb
Instance Method Summary collapse
-
#color(type, str) ⇒ Object
TODO: Use a highline color scheme here instead.
Instance Method Details
#color(type, str) ⇒ Object
TODO: Use a highline color scheme here instead
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/health_inspector/color.rb', line 4 def color(type, str) colors = { 'pass' => [:green], # 90, 'fail' => [:red], # 31, 'bright pass' => [:bold, :green], # 92, 'bright fail' => [:bold, :red], # 91, 'bright yellow' => [:bold, :yellow], # 93, 'pending' => [:yellow], # 36, 'suite' => [], # 0, 'error title' => [], # 0, 'error message' => [:red], # 31, 'error stack' => [:green], # 90, 'checkmark' => [:green], # 32, 'fast' => [:green], # 90, 'medium' => [:green], # 33, 'slow' => [:red], # 31, 'green' => [:green], # 32, 'light' => [:green], # 90, 'diff gutter' => [:green], # 90, 'diff added' => [:green], # 42, 'diff removed' => [:red]# 41 } @context.knife.ui.color(str, *colors[type]) end |