Class: Clacky::DeployTools::ReportDeployStatus
- Inherits:
-
Object
- Object
- Clacky::DeployTools::ReportDeployStatus
- Defined in:
- lib/clacky/default_skills/deploy/tools/report_deploy_status.rb
Overview
Report deployment status to user with formatted output
Constant Summary collapse
- VALID_STATUSES =
%w[analyzing deploying checking success failed].freeze
- STATUS_ICONS =
{ 'analyzing' => '🔍', 'deploying' => '🚀', 'checking' => '✅', 'success' => '🎉', 'failed' => '❌' }.freeze
- STATUS_COLORS =
{ 'analyzing' => :cyan, 'deploying' => :yellow, 'checking' => :blue, 'success' => :green, 'failed' => :red }.freeze
Class Method Summary collapse
-
.execute(status:, message:) ⇒ Hash
Execute the report_deploy_status command.
-
.format_message(status, message, icon) ⇒ String
Format the status message with icon and styling.
Class Method Details
.execute(status:, message:) ⇒ Hash
Execute the report_deploy_status command
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/clacky/default_skills/deploy/tools/report_deploy_status.rb', line 30 def self.execute(status:, message:) unless VALID_STATUSES.include?(status) return { error: "Invalid status", details: "Status must be one of: #{VALID_STATUSES.join(', ')}", provided: status } end icon = STATUS_ICONS[status] = (status, , icon) # Output to stdout puts { success: true, status: status, message: , timestamp: Time.now.iso8601 } end |
.format_message(status, message, icon) ⇒ String
Format the status message with icon and styling
59 60 61 62 63 64 |
# File 'lib/clacky/default_skills/deploy/tools/report_deploy_status.rb', line 59 def self.(status, , icon) = Time.now.strftime("%H:%M:%S") status_label = status.upcase.ljust(10) "#{icon} [#{}] #{status_label} #{}" end |