module CommandKit::Printing
Provides printing methods.
Constants
- EOL
Platform independent new-line constant
@return [String]
@api public
Public Instance Methods
print_error(message)
click to toggle source
Prints the error message to {Stdio#stderr stderr}.
@param [String] message
The error message.
@example
print_error "Error: invalid input"
@api public
# File lib/command_kit/printing.rb, line 30 def print_error(message) stderr.puts message end
print_exception(error)
click to toggle source
Prints an exception to {Stdio#stderr stderr}.
@param [Exception] error
The error to print.
@example
begin # ... rescue => error print_error "Error encountered" print_exception(error) exit(1) end
@api public
# File lib/command_kit/printing.rb, line 51 def print_exception(error) print_error error.full_message(highlight: stderr.tty?) end