Module: FunCi::Tui::AnimationFrames

Defined in:
lib/fun_ci/tui/animation_frames.rb

Constant Summary collapse

RESET =
Ansi::RESET
8

Class Method Summary collapse

Class Method Details



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fun_ci/tui/animation_frames.rb', line 36

def self.failure_footer(stage_name, width)
  up = stage_name.upcase
  down = stage_name.downcase
  hold [
    nil,
    center("\e[1;31m>>> #{up} FAILED <<<#{RESET}", ">>> #{up} FAILED <<<", width),
    center("\e[31m>> #{down} failed <<#{RESET}", ">> #{down} failed <<", width),
    center("\e[2;31m> #{down} failed <#{RESET}", "> #{down} failed <", width),
    nil
  ]
end

.failure_header(width) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fun_ci/tui/animation_frames.rb', line 23

def self.failure_header(width)
  boom = "BOOM"
  [
    nil,
    banner(boom, width, "\e[48;5;124m", particles: "* "),
    banner(boom, width, "\e[48;5;166m", particles: "* * "),
    banner(boom, width, "\e[48;5;52m",  particles: ". * * "),
    banner(boom, width, "\e[48;5;236m", particles: "' . * "),
    banner(boom, width, "\e[48;5;236m", particles: ". "),
    nil
  ]
end

.failure_particlesObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fun_ci/tui/animation_frames.rb', line 11

def self.failure_particles
  [
    { chars: "*",     color: "\e[1;31m" },
    { chars: ".*",    color: "\e[1;31m" },
    { chars: ".+*.",  color: "\e[38;5;208m" },
    { chars: "*.+'",  color: "\e[38;5;208m" },
    { chars: "' .",   color: "\e[38;5;52m" },
    { chars: ".",     color: "\e[38;5;52m" },
    { chars: "",      color: "" }
  ]
end

.stage_pass_colorsObject



81
82
83
# File 'lib/fun_ci/tui/animation_frames.rb', line 81

def self.stage_pass_colors
  ["\e[1;33m", "\e[1;32m", "\e[32m"]
end


62
63
64
65
66
67
68
69
70
# File 'lib/fun_ci/tui/animation_frames.rb', line 62

def self.success_footer(width)
  hold [
    nil,
    center("\e[1;32m* * * NICE! * * *#{RESET}", "* * * NICE! * * *", width),
    center("\e[32m. + . * NICE! * . + .#{RESET}", ". + . * NICE! * . + .", width),
    center("\e[2;32m' . + .  nice  . + . '#{RESET}", "' . + .  nice  . + . '", width),
    nil
  ]
end

.success_header(width) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/fun_ci/tui/animation_frames.rb', line 48

def self.success_header(width)
  text = "ALL PASSED"
  [
    nil,
    banner(text, width, "\e[48;5;22m",  particles: ""),
    banner(text, width, "\e[48;5;22m",  particles: "*  * "),
    banner(text, width, "\e[48;5;22m",  particles: "* .  . "),
    banner(text, width, "\e[48;5;58m",  particles: ". '  ' "),
    banner(text, width, "\e[48;5;22m",  particles: "' "),
    banner(text, width, "\e[48;5;22m",  particles: ""),
    nil
  ]
end

.timeout_colorsObject



85
86
87
# File 'lib/fun_ci/tui/animation_frames.rb', line 85

def self.timeout_colors
  ["\e[1;33m", "\e[33m", "\e[1;33m", "\e[33m"]
end

.timeout_header(width) ⇒ Object



72
73
74
75
76
77
78
79
# File 'lib/fun_ci/tui/animation_frames.rb', line 72

def self.timeout_header(width)
  [
    nil,
    banner("TIMED OUT", width, "\e[48;5;58m", particles: ""),
    banner("timed out", width, "\e[48;5;58m", particles: ""),
    nil
  ]
end