module

Inquirer::Console

Provides Inquirer with various printing utilities.

Constants

COLUMNS = ENV["COLUMNS"]?.try(&.to_i) || 80

The amount of columns in terminal.

DONE_FORE = Colorize::ColorRGB.new(165, 214, 167)

Done plaque background color.

ERROR_FORE = Colorize::ColorRGB.new(239, 154, 154)

Error plaque background color.

PROGRESS_FORE = Colorize::ColorRGB.new(144, 202, 249)

Progress plaque background color.

Instance methods

done(message : String)

Displays a done plaque followed by message.

Source
error(message : String)

Displays an error plaque followed by message.

Source
exit(status : Int32, message : String)

Exits with status status.

If status is not zero, an error with the given message is printed.

Source
progress(message : String)

Displays a progress plaque followed by message.

Source
update(message : String)

Displays message, assuming it will change the next moment.

Works like Crystal's print, but returns the carriage to the start of the line and clears that line before printing.

Cuts off the message if it is too long to display on one line.

Returns nothing.

Source

Macros

logging(before, after, given)

Logs progress with message before, executes given and logs done with message after.

Returns whatever given returned.

Source