Module: GemHadar::SimpleCov::WarnModule
- Included in:
- GemHadar::SimpleCov, ContextFormatter
- Defined in:
- lib/gem_hadar/simplecov.rb
Overview
A module that provides warning functionality with colored output.
This module enhances the standard warn method to display warning messages in orange color, making them more visible in terminal outputs. It is designed to be included in classes that need consistent warning message formatting throughout the application.
Instance Method Summary collapse
-
#warn(*msgs) ⇒ Object
The warn method displays warning messages using orange colored output.
Instance Method Details
#warn(*msgs) ⇒ Object
The warn method displays warning messages using orange colored output.
This method takes an array of message strings, applies orange color formatting to each message, and then passes them to the superclass’s warn method for display. The uplevel: 1 option ensures that the warning originates from the caller’s context rather than from within this method itself.
45 46 47 48 |
# File 'lib/gem_hadar/simplecov.rb', line 45 def warn(*msgs) msgs.map! { |m| color(208) { m } } super(*msgs, uplevel: 1) end |