Class: DependencyTimelineAudit::TextFormat
- Inherits:
-
Object
- Object
- DependencyTimelineAudit::TextFormat
- Defined in:
- lib/dependency-timeline-audit/text_format.rb
Class Method Summary collapse
- .bold ⇒ Object
- .color=(color) ⇒ Object
- .green ⇒ Object
- .red ⇒ Object
- .reset ⇒ Object
- .reset! ⇒ Object
- .style=(style) ⇒ Object
- .yellow ⇒ Object
Class Method Details
.bold ⇒ Object
34 35 36 |
# File 'lib/dependency-timeline-audit/text_format.rb', line 34 def bold "\e[1m" end |
.color=(color) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/dependency-timeline-audit/text_format.rb', line 4 def color=(color) case color when :red print red when :green print green when :yellow print yellow else raise ArgumentError, "Unknown color: #{color}" end end |
.green ⇒ Object
42 43 44 |
# File 'lib/dependency-timeline-audit/text_format.rb', line 42 def green "\e[32m" end |
.red ⇒ Object
38 39 40 |
# File 'lib/dependency-timeline-audit/text_format.rb', line 38 def red "\e[31m" end |
.reset ⇒ Object
30 31 32 |
# File 'lib/dependency-timeline-audit/text_format.rb', line 30 def reset "\e[0m" end |
.reset! ⇒ Object
26 27 28 |
# File 'lib/dependency-timeline-audit/text_format.rb', line 26 def reset! print reset end |
.style=(style) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/dependency-timeline-audit/text_format.rb', line 17 def style=(style) case style when :bold print bold else raise ArgumentError, "Unknown style: #{style}" end end |
.yellow ⇒ Object
46 47 48 |
# File 'lib/dependency-timeline-audit/text_format.rb', line 46 def yellow "\e[33m" end |