Add this to your application's shard.yml
:
dependencies:
spinner-frames:
github: gtramontina/spinner-frames.cr
version: <version>
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 } # [ ][- ][ - ][ -][ ]
- Fork it ( https://github.com/gtramontina/spinner-frames.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request