Module: Spill::Spinner
- Defined in:
- lib/spill/spinner.rb
Constant Summary collapse
- FRAMES =
[ "🫖 spilling the tea", "🫖 spilling the tea.", "🫖 spilling the tea..", "🍵 spilling the tea..." ].freeze
- INTERVAL =
0.15
Class Method Summary collapse
Class Method Details
.around(enabled:, out: $stderr) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/spill/spinner.rb', line 8 def around(enabled:, out: $stderr) return yield unless enabled thread = spin(out) begin yield ensure thread.kill thread.join out.print "\r\e[K" end end |