Class: Thor::Shell::Basic
- Inherits:
-
Object
- Object
- Thor::Shell::Basic
- Defined in:
- lib/branch/name/cli/thor_ext/shell/basic/say_error.rb
Instance Method Summary collapse
-
#say_error(message, color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/)) ⇒ Object
Prints an error message to ‘stderr`.
Instance Method Details
#say_error(message, color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/)) ⇒ Object
Prints an error message to ‘stderr`.
21 22 23 24 25 26 27 28 29 |
# File 'lib/branch/name/cli/thor_ext/shell/basic/say_error.rb', line 21 def say_error(, color = nil, force_new_line = (.to_s !~ /( |\t)\Z/)) return if quiet? buffer = (, *color) buffer << $INPUT_RECORD_SEPARATOR if force_new_line && !.to_s.end_with?($INPUT_RECORD_SEPARATOR) stderr.print(buffer) stderr.flush end |