Module: Sphyg
- Defined in:
- lib/sphyg.rb,
lib/sphyg/pulse.rb,
lib/sphyg/version.rb,
lib/sphyg/throbber.rb,
lib/sphyg/enumerators/base.rb,
lib/sphyg/enumerators/cycle.rb,
lib/sphyg/enumerators/rotate.rb
Overview
Top-level namespace
Defined Under Namespace
Modules: Enumerators Classes: Pulse, Throbber
Constant Summary collapse
- THROBBERS =
{ ascii: { enumerator: '::Sphyg::Enumerators::Cycle', frames: %w[| / - \\], rate: 0.1 }, elipsis: { enumerator: '::Sphyg::Enumerators::Cycle', frames: %w[. .. ... ..], rate: 0.2 }, heart: { enumerator: '::Sphyg::Enumerators::Cycle', frames: %w[𧑠π π π π], rate: 0.1 }, heroku: { enumerator: '::Sphyg::Enumerators::Cycle', frames: %w[β£Ύ β£½ β£» β’Ώ β‘Ώ β£ β£― β£·], rate: 0.1 }, moon: { enumerator: '::Sphyg::Enumerators::Cycle', frames: %w[π π π π π π π π], rate: 0.2 }, time: { enumerator: '::Sphyg::Enumerators::Cycle', frames: %w[π π π π π π π π π π π], rate: 1 }, wave: { enumerator: '::Sphyg::Enumerators::Rotate', frames: %w[β‘ β β β β β ], rate: 0.1 } }.freeze
- VERSION =
'0.3.1'.freeze
Class Method Summary collapse
-
.pulse(message, options = nil, &blk) ⇒ Object
- Presents a message and throbber Params:
message
- friendly
string
to display that indicates a command is running for example, βPlease waitβoptions
- configuration
hash
&blk -
a
block
containing a long-running command to run while displaying the message and throbber.
- configuration
- friendly
- Presents a message and throbber Params:
Class Method Details
.pulse(message, options = nil, &blk) ⇒ Object
Presents a message and throbber Params:
message
-
friendly
string
to display that indicates a command is running
for example, 'Please wait'
options
-
configuration
hash
- &blk
-
a
block
containing a long-running command to run while displaying
the and throbber
51 52 53 |
# File 'lib/sphyg.rb', line 51 def self.pulse(, = nil, &blk) ::Sphyg::Pulse.new(, ).run { yield blk } end |