Module: Aidp::MessageDisplay::ClassMethods

Included in:
CLI
Defined in:
lib/aidp/message_display.rb

Instance Method Summary collapse

Instance Method Details

#display_message(message, type: :info) ⇒ Object

Class-level display helper (uses fresh prompt to respect $stdout changes)



47
48
49
50
51
52
53
# File 'lib/aidp/message_display.rb', line 47

def display_message(message, type: :info)
  # Ensure message is UTF-8 encoded to handle emoji and special characters
  message_str = message.to_s
  message_str = message_str.force_encoding("UTF-8") if message_str.encoding.name == "ASCII-8BIT"
  message_str = message_str.encode("UTF-8", invalid: :replace, undef: :replace)
  class_message_display_prompt.say(message_str, color: COLOR_MAP.fetch(type, :white))
end