Sha256: f5c4d686dc4841d4a10512b1a826307ef150d143abbba5c4cd34081064624093
Contents?: true
Size: 427 Bytes
Versions: 19
Compression:
Stored size: 427 Bytes
Contents
require 'singleton' require 'guignol' module Guignol class TtySpinner include Singleton Chars = ['/','|','\\', '-'] def initialize @state = 0 end def spin! if $stderr.tty? && !Guignol.env.test? $stderr.write(Chars[@state % Chars.size] + "\r") $stderr.flush @state += 1 end Thread.pass end def self.spin! instance.spin! end end end
Version data entries
19 entries across 19 versions & 1 rubygems