spinner-frames

A collection of spinner frames crystal-shard crystal-shards terminal
1.0.0 Latest release released

spinner-frames.cr

A collection of spinner frames

spinner-frames


Installation

Add this to your application's shard.yml:

dependencies:
  spinner-frames:
    github: gtramontina/spinner-frames.cr
    version: <version>

Usage

First require it…

require "spinner-frames"

Then you can use the default charset (:line)…

s = SpinnerFrames.new
5.times { print s.next } # -\|/-

… any of the built-in charsets…

s = SpinnerFrames.new(SpinnerFrames::Charset[:arc])
5.times { print s.next } # ◜◠◝◞◡

… provide a new charset as String

s = SpinnerFrames.new("01234")
5.times { print s.next } # 01234

… or as Array(String)

s = SpinnerFrames.new(["[   ]", "[-  ]", "[ - ]", "[  -]", "[   ]"])
5.times { print s.next } # [   ][-  ][ - ][  -][   ]

Contributing

  1. Fork it ( https://github.com/gtramontina/spinner-frames.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Related

  • https://github.com/gtramontina/ansi-escapes.cr

travis build

spinner-frames:
  github: gtramontina/spinner-frames.cr
  version: ~> 1.0.0
License MIT
Crystal none

Authors

Dependencies 0

Development Dependencies 1

  • ansi-escapes 1.0.0
    {'github' => 'gtramontina/ansi-escapes.cr', 'version' => '1.0.0'}

Dependents 2

Last synced .
search fire star recently