Class: Utilities
- Inherits:
-
Object
- Object
- Utilities
- Defined in:
- lib/fastlane/plugin/flutter_tests/utils/utilities.rb
Instance Method Summary collapse
-
#colorize(message, color) ⇒ String
Colorize a message.
-
#initialize ⇒ Utilities
constructor
A new instance of Utilities.
Constructor Details
#initialize ⇒ Utilities
Returns a new instance of Utilities.
3 4 5 6 7 8 9 |
# File 'lib/fastlane/plugin/flutter_tests/utils/utilities.rb', line 3 def initialize @colors = { 'blue' => 34, 'green' => 32, 'red' => 31, } end |
Instance Method Details
#colorize(message, color) ⇒ String
Colorize a message. If the color specified doesn’t exists, returns the default message
17 18 19 20 21 22 23 24 |
# File 'lib/fastlane/plugin/flutter_tests/utils/utilities.rb', line 17 def colorize(, color) if @colors.has_key? color color_code = @colors[color] "\e[#{color_code}m#{}\e[0m" else end end |