Sha256: 9d59bd12bf8fc4430a53299f2713fe00224b50afa182aaa5c7ef6543b0b76b56

Contents?: true

Size: 547 Bytes

Versions: 1

Compression:

Stored size: 547 Bytes

Contents

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

require 'cli_spinnable'

module Foo
  extend CliSpinnable
end

puts 'HAPPY RUN (ending with success):'
Foo.with_spinner do |cli|
  cli.print 'Downloading something'
  sleep 1
  cli.print '...downloaded 1MB'
  cli.tick
  cli.print 'Processing data'
  sleep 1
  cli.tick
end

puts 'SAD RUN (ending with fail):'
Foo.with_spinner do |cli|
  cli.print 'Downloading something'
  sleep 1
  cli.print '...downloaded 1MB'
  cli.tick
  cli.print 'Processing data'
  sleep 1
  1 / 0
  cli.tick
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cli_spinnable-0.1 examples/example2.rb