lib/sample_cmdlet_patterns/commands/spinner_simple.rb
# Execute SpinnerSimple subcommand taking input from
# a input stream and writing to output stream
#
# sample: output.puts 'OK'
Execute SpinnerSimple subcommand taking input from
a input stream and writing to output stream


Execute SpinnerSimple subcommand taking input from a input stream and writing to output stream
def execute(input: $stdin, output: $stdout)
        spinner = TTY::Spinner.new
        spinner.auto_spin 
        sleep(2) 
        spinner.stop('Done!') 
        spinner = TTY::Spinner.new('[:spinner] Loading ...', format: :pulse_2)
        spinner.auto_spin 
        sleep(2) 
        spinner.stop('Done!') 
        :gui
      end
def execute ( input : $stdin , output : $stdout ) spinner = TTY :: Spinner . new spinner . auto_spin sleep ( 2 ) spinner . stop ( 'Done!' ) spinner = TTY :: Spinner . new ( '[:spinner] Loading ...' , format : :pulse_2 ) spinner . auto_spin sleep ( 2 ) spinner . stop ( 'Done!' ) :gui end
Execute SpinnerSimple subcommand taking input from
a input stream and writing to output stream
Execute SpinnerSimple subcommand taking input from a input stream and writing to output stream
# Automatic animation with default interval # Perform task # Stop animation # Automatic animation with default interval # Perform task # Stop animation
input
output