Module: Kdeploy::Banner
- Defined in:
- lib/kdeploy/banner.rb
Overview
Banner display module for CLI output
Constant Summary collapse
- ASCII_LOGO =
<<~'LOGO' _ _ /\ /\__| | ___ _ __ | | ___ _ _ / //_/ _` |/ _ \ '_ \| |/ _ \| | | | / __ \ (_| | __/ |_) | | (_) | |_| | \/ \/\__,_|\___| .__/|_|\___/ \__, | |_| |___/ LOGO
Class Method Summary collapse
- .show ⇒ Object
- .show_error(message, include_banner: false) ⇒ Object
- .show_success(message, include_banner: false) ⇒ Object
- .show_version ⇒ Object
Class Method Details
.show ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/kdeploy/banner.rb', line 9 def show pastel = Pastel.new <<~BANNER #{pastel.bright_blue(ASCII_LOGO)} #{pastel.bright_yellow('⚡')} #{pastel.bright_white('Lightweight Agentless Deployment Tool')} #{pastel.bright_yellow('🚀')} #{pastel.bright_white('Deploy with confidence, scale with ease')} ===================================================================================================== BANNER end |
.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(, include_banner: false) pastel = Pastel.new error_msg = pastel.red("Error: #{}") if <<~ERROR #{show} #{error_msg} ERROR else <<~ERROR #{error_msg} ERROR end end |
.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(, include_banner: false) pastel = Pastel.new success_msg = pastel.green("Success: #{}") if <<~SUCCESS #{show} #{success_msg} SUCCESS else <<~SUCCESS #{success_msg} SUCCESS end end |
.show_version ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/kdeploy/banner.rb', line 22 def show_version pastel = Pastel.new <<~VERSION #{show} #{pastel.bright_white("Version: #{VERSION}")} VERSION end |