Module: Kdeploy::Banner

Defined in:
lib/kdeploy/banner.rb

Overview

Banner display module for CLI output

Constant Summary collapse

ASCII_LOGO =
"          _            _\n  /\\ /\\__| | ___ _ __ | | ___  _   _\n / //_/ _` |/ _ \\ '_ \\| |/ _ \\| | | |\n/ __ \\ (_| |  __/ |_) | | (_) | |_| |\n\\/  \\/\\__,_|\\___| .__/|_|\\___/ \\__, |\n                |_|            |___/\n"

Class Method Summary collapse

Class Method Details

.showObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/kdeploy/banner.rb', line 9

def show
  pastel = Pastel.new
  "    \#{pastel.bright_blue(ASCII_LOGO)}\n\n    \#{pastel.bright_yellow('\u26A1')} \#{pastel.bright_white('Lightweight Agentless Deployment Tool')}\n    \#{pastel.bright_yellow('\u{1F680}')} \#{pastel.bright_white('Deploy with confidence, scale with ease')}\n\n    =====================================================================================================\n\n  BANNER\nend\n"

.show_error(message, include_banner: false) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/kdeploy/banner.rb', line 31

def show_error(message, include_banner: false)
  pastel = Pastel.new
  error_msg = pastel.red("Error: #{message}")
  if include_banner
    "      \#{show}\n      \#{error_msg}\n\n    ERROR\n  else\n    <<~ERROR\n      \#{error_msg}\n\n    ERROR\n  end\nend\n"

.show_success(message, include_banner: false) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/kdeploy/banner.rb', line 48

def show_success(message, include_banner: false)
  pastel = Pastel.new
  success_msg = pastel.green("Success: #{message}")
  if include_banner
    "      \#{show}\n      \#{success_msg}\n\n    SUCCESS\n  else\n    <<~SUCCESS\n      \#{success_msg}\n\n    SUCCESS\n  end\nend\n"

.show_versionObject



22
23
24
25
26
27
28
29
# File 'lib/kdeploy/banner.rb', line 22

def show_version
  pastel = Pastel.new
  "    \#{show}\n    \#{pastel.bright_white(\"Version: \#{VERSION}\")}\n\n  VERSION\nend\n"