Method: Hu::Cli::Collab#show_plan

Defined in:
lib/hu/collab.rb

#show_plan(plan) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/hu/collab.rb', line 61

def show_plan(plan)
  plan.each do |s|
    color = OP_COLORS[s[:op]]
    msg = ''
    icon = ' '
    if s[:method].nil?
      color = "\e[0m"
      msg = '<-- Can not resolve this (NO-OP)'
      icon = '⚠️'
    elsif s[:invalid]
      color = "\e[0m"
      icon = '⚠️'
    end
    STDERR.printf "%1s %s%6s %-30s %-15s %-30s %s\e[0m\n", icon, color, s[:op_name], s[:app_name], s[:role], s[:value], msg
    if s[:invalid]
      STDERR.puts "\e[31;1m         Error: #{s[:invalid]}\e[0m\n\n"
    end
  end
end