Skip to content

Latest commit

 

History

History
66 lines (49 loc) · 1.51 KB

README.md

File metadata and controls

66 lines (49 loc) · 1.51 KB

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


travis build