Method: Utils::ProbeServer#output_message

Defined in:
lib/utils/probe_server.rb

#output_message(msg, type: nil) ⇒ Object



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/utils/probe_server.rb', line 177

def output_message(msg, type: nil)
  msg.respond_to?(:to_a) and msg = msg.to_a * "\n"
  msg =
    case type
    when :success
      msg.on_color(22).white
    when :info
      msg.on_color(20).white
    when :warn
      msg.on_color(94).white
    when :failure
      msg.on_color(124).blink.white
    else
      msg
    end
  STDOUT.puts msg
  STDOUT.flush
  self
end