Class: Chelsea::Spinner

Inherits:
Object
  • Object
show all
Defined in:
lib/chelsea/spinner.rb

Overview

the spinner we use in Chelsea, needs work

Instance Method Summary collapse

Constructor Details

#initializeSpinner

Returns a new instance of Spinner.



25
26
27
# File 'lib/chelsea/spinner.rb', line 25

def initialize
  @pastel = Pastel.new
end

Instance Method Details

#spin_msg(msg) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/chelsea/spinner.rb', line 29

def spin_msg(msg)
  format = "[#{@pastel.green(':spinner')}] " + @pastel.white(msg)
  spinner = TTY::Spinner.new(
    format,
    success_mark: @pastel.green('+'),
    hide_cursor: true
  )
  spinner.auto_spin
  spinner
end