class

Term::Spinner

Inherits Reference / Object

Constants

CROSS = "✖"
ECMA_CSI = "\e["
FORMATS = {"classic" => { interval: 10, frames: ["|", "/", "-", "\\"], }, "spin" => { interval: 10, frames: ["◴", "◷", "◶", "◵"] of ::String, }, "spin_2" => { interval: 10, frames: ["◐", "◓", "◑", "◒"] of ::String, }, "spin_3" => { interval: 10, frames: ["◰", "◳", "◲", "◱"] of ::String, }, "spin_4" => { interval: 10, frames: ["╫", "╪"] of ::String, }, "pulse" => { interval: 10, frames: ["⎺", "⎻", "⎼", "⎽", "⎼", "⎻"] of ::String, }, "pulse_2" => { interval: 15, frames: ["▁", "▃", "▅", "▆", "▇", "█", "▇", "▆", "▅", "▃"] of ::String, }, "pulse_3" => { interval: 20, frames: ["▉", "▊", "▋", "▌", "▍", "▎", "▏", "▎", "▍", "▌", "▋", "▊", "▉"] of ::String, }, "dots" => { interval: 10, frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"] of ::String, }, "dots_2" => { interval: 10, frames: ["⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"] of ::String, }, "dots_3" => { interval: 10, frames: ["⠋", "⠙", "⠚", "⠞", "⠖", "⠦", "⠴", "⠲", "⠳", "⠓"] of ::String, }, "dots_4" => { interval: 10, frames: ["⠄", "⠆", "⠇", "⠋", "⠙", "⠸", "⠰", "⠠", "⠰", "⠸", "⠙", "⠋", "⠇", "⠆"] of ::String, }, "dots_5" => { interval: 10, frames: ["⠋", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋"] of ::String, }, "dots_6" => { interval: 10, frames: ["⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠴", "⠲", "⠒", "⠂", "⠂", "⠒", "⠚", "⠙", "⠉", "⠁"] of ::String, }, "dots_7" => { interval: 10, frames: ["⠈", "⠉", "⠋", "⠓", "⠒", "⠐", "⠐", "⠒", "⠖", "⠦", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈"] of ::String, }, "dots_8" => { interval: 10, frames: ["⠁", "⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈", "⠈"] of ::String, }, "dots_9" => { interval: 10, frames: ["⢹", "⢺", "⢼", "⣸", "⣇", "⡧", "⡗", "⡏"] of ::String, }, "dots_10" => { interval: 10, frames: ["⢄", "⢂", "⢁", "⡁", "⡈", "⡐", "⡠"] of ::String, }, "dots_11" => { interval: 10, frames: ["⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"] of ::String, }, "arrow" => { interval: 10, frames: ["←", "↖", "↑", "↗", "→", "↘", "↓", "↙"] of ::String, }, "arrow_pulse" => { interval: 10, frames: ["▹▹▹▹▹", "▸▹▹▹▹", "▹▸▹▹▹", "▹▹▸▹▹", "▹▹▹▸▹", "▹▹▹▹▸"], }, "triangle" => { interval: 10, frames: ["◢", "◣", "◤", "◥"] of ::String, }, "arc" => { interval: 10, frames: ["◜", "◠", "◝", "◞", "◡", "◟"] of ::String, }, "pipe" => { interval: 10, frames: ["┤", "┘", "┴", "└", "├", "┌", "┬", "┐"] of ::String, }, "bouncing" => { interval: 10, frames: ["[ ]", "[ =]", "[ ==]", "[ ===]", "[====]", "[=== ]", "[== ]", "[= ]"], }, "bouncing_ball" => { interval: 10, frames: ["( ● )", "( ● )", "( ● )", "( ● )", "( ●)", "( ● )", "( ● )", "( ● )", "( ● )", "(● )"], }, "bounce" => { interval: 10, frames: ["⠁", "⠂", "⠄", "⠂"] of ::String, }, "box_bounce" => { interval: 10, frames: ["▌", "▀", "▐", "▄"] of ::String, }, "box_bounce_2" => { interval: 10, frames: ["▖", "▘", "▝", "▗"] of ::String, }, "star" => { interval: 10, frames: ["✶", "✸", "✹", "✺", "✹", "✷"] of ::String, }, "toggle" => { interval: 10, frames: ["■", "□", "▪", "▫"] of ::String, }, "balloon" => { interval: 10, frames: [".", "o", "O", "@", "*"] of ::String, }, "balloon_2" => { interval: 10, frames: [".", "o", "O", "°", "O", "o", "."] of ::String, }, "flip" => { interval: 10, frames: ["-", "◡", "⊙", "-", "◠"] of ::String, }, "burger" => { interval: 6, frames: ["☱", "☲", "☴"] of ::String, }, "dance" => { interval: 10, frames: [">))'>", " >))'>", " >))'>", " >))'>", " >))'>", " <'((<", " <'((<", " <'((<"], }, "shark" => { interval: 10, frames: ["▐|\\____________▌", "▐_|\\___________▌", "▐__|\\__________▌", "▐___|\\_________▌", "▐____|\\________▌", "▐_____|\\_______▌", "▐______|\\______▌", "▐_______|\\_____▌", "▐________|\\____▌", "▐_________|\\___▌", "▐__________|\\__▌", "▐___________|\\_▌", "▐____________|\\▌", "▐____________/|▌", "▐___________/|_▌", "▐__________/|__▌", "▐_________/|___▌", "▐________/|____▌", "▐_______/|_____▌", "▐______/|______▌", "▐_____/|_______▌", "▐____/|________▌", "▐___/|_________▌", "▐__/|__________▌", "▐_/|___________▌", "▐/|____________▌"], }, "pong" => { interval: 10, frames: ["▐⠂ ▌", "▐⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂▌", "▐ ⠠▌", "▐ ⡀▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐⠠ ▌"], }}
MATCHER = /:spinner/
TICK = "✔"
VERSION = "1.0.0"

Constructors

new(*args, **options)
Source

Instance methods

attach_to(multispinner : Multi)

Notifies the Spinner that it is running under a multispinner

Source
auto_spin

Start automatic spinning animation

Source
clear_line

Clear the current line

Source
done?

Whether the spinner has completed spinning

Source
duration

Duration of the spinning animation

Source
error(stop_message = "")

Finish spinning and set state to :error

Source
error?

Whether the spinner is in the error state. This is only true temporarily while it is being marked with a failure mark.

Source
execute_job

Execute this spinner job

Source
execute_on_line
Source
first_run?

Whether this is the first time this spinner has ran

Source
frames

The animation frames

Source
hide_cursor

Whether to show or hide the cursor

Source
interval

The animation interval

Source
job

Add job to the spinner

Source
job

Get the current job

Source
job?

Check if this spinner has a scheduled job

Source
message

The message to print before the spinner

Source
multispinner
Source
next_char

Retrieve next character

Source
on(name, &block : Spinner -> )

Register a callback

Source
output

The object that responds to print call defaulting to stderr

Source
pause

Pause the spinner

Source
paused?

Whether the spinner is paused

Source
redraw_indent

Redraw the indent for this spinner, if it exists

Source
reset
Source
resume

Resume spinner

Source
row

The current row inside a multi spinner

Source
run(stop_message = "", &block : Spinner -> )

Runspinner while executing job

Source
spin

Perform a spin

Source
spinning?

Whether the spinner is spinning

Source
start

Start timer and unlock spinner

Source
state

The current spinner state

Source
stop(stop_message = "")

Stop the running spinner

Source
stopped?

Whether spinner is stopped

Source
success(stop_message = "")

Finish spinning and set state to :success

Source
success?

Whether the spinner is in the success state. When true the spinner is marked with a success mark.

Source
tokens

Tokens for the message

Source
tty?
Source
update

Update string formatting tokens

Source

Nested types