Class: DependencyTimelineAudit::TextFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/dependency-timeline-audit/text_format.rb

Class Method Summary collapse

Class Method Details

.boldObject



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

.greenObject



42
43
44
# File 'lib/dependency-timeline-audit/text_format.rb', line 42

def green
  "\e[32m"
end

.redObject



38
39
40
# File 'lib/dependency-timeline-audit/text_format.rb', line 38

def red
  "\e[31m"
end

.resetObject



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

.yellowObject



46
47
48
# File 'lib/dependency-timeline-audit/text_format.rb', line 46

def yellow
  "\e[33m"
end