Module: Kolorit::Linux

Defined in:
lib/kolorit/linux.rb

Overview

TODO:

Use ‘def red = kolor(int)` in ruby > 3.0

kolor codes for linux systems. Allow use of kolor methods when included in class.

Instance Method Summary collapse

Instance Method Details



53
54
55
# File 'lib/kolorit/linux.rb', line 53

def blink
  kolor(5)
end

#blueObject



25
26
27
# File 'lib/kolorit/linux.rb', line 25

def blue
  kolor(34)
end

#boldObject



41
42
43
# File 'lib/kolorit/linux.rb', line 41

def bold
  kolor(1)
end

#colorize(clr) ⇒ Object

this is part of code that make rubocop sad



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/kolorit/linux.rb', line 64

def colorize(clr)
  case clr.to_sym
  when :red then red
  when :green then green
  when :yellow then yellow
  when :blue then blue
  when :pink then pink
  when :cyan then cyan
  when :gray then gray
  when :bold then bold
  when :italic then italic
  when :underline then underline
  when :blink then blink
  when :reverse_color, :inverse then reverse_color
  else self
  end
end

#cyanObject



33
34
35
# File 'lib/kolorit/linux.rb', line 33

def cyan
  kolor(36)
end

#grayObject



37
38
39
# File 'lib/kolorit/linux.rb', line 37

def gray
  kolor(37)
end

#greenObject



17
18
19
# File 'lib/kolorit/linux.rb', line 17

def green
  kolor(32)
end

#italicObject



45
46
47
# File 'lib/kolorit/linux.rb', line 45

def italic
  kolor(3)
end

#pinkObject



29
30
31
# File 'lib/kolorit/linux.rb', line 29

def pink
  kolor(35)
end

#redObject



13
14
15
# File 'lib/kolorit/linux.rb', line 13

def red
  kolor(31)
end

#reverse_colorObject Also known as: inverse



57
58
59
# File 'lib/kolorit/linux.rb', line 57

def reverse_color
  kolor(7)
end

#underlineObject



49
50
51
# File 'lib/kolorit/linux.rb', line 49

def underline
  kolor(4)
end

#yellowObject



21
22
23
# File 'lib/kolorit/linux.rb', line 21

def yellow
  kolor(33)
end