Sha256: da5e5a2980226fad5863afd6393b7e54ee2797b5aa521142e0014aa53eeac159

Contents?: true

Size: 588 Bytes

Versions: 1

Compression:

Stored size: 588 Bytes

Contents

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

require 'cli_spinnable'

module Cli
  extend CliSpinnable
end

puts 'HAPPY RUN (should succeed):'
Cli.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 (should fail):'
Cli.with_spinner do |cli|
  cli.print 'Downloading something'
  sleep 1
  cli.print '...downloaded 1MB'
  cli.tick
  cli.print 'Processing data'
  sleep 1
  1 / 0    # produces exception
  cli.tick # this will not be reached
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cli_spinnable-0.2 examples/example2.rb