termspinner

A simple terminal spinner in crystal
HEAD Latest release Yanked release released
eliobr/termspinner
4
eliobr

This repo seems to be no longer available at eliobr/termspinner.

Git synchronization failed . Last successful sync was .

Help find it again! … or have it archived.

spinner

A simple terminal spinner written in crystal

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      termspinner:
        github: eliobr/termspinner
    
  2. Run shards install

Usage

require "termspinner"
spi = Spinner::Spinner.new("Waiting...")
begin
  spi.start()
  response = HTTP::Client.get("https://cataas.com/cat/gif")
  if response.status_code == 200
    spi.success("Success")
  else
    spi.error("Failed")
  end
rescue
  spi.error("Error while trying to connect")
end
spi.start("Doing something useful...")
sleep(2.seconds)
spi.message= "The process is taking longer than expected..."
sleep(3)
spi.error("Failed to do something useful")
spi.start("Doing something...")
sleep(2.seconds)
spi.stop("⚠️  Some custom message".colorize(:yellow).to_s)

Contributing

  1. Fork it (https://github.com/eliobr/termspinner/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

Contributors

  • elio - creator and maintainer
termspinner:
  github: eliobr/termspinner
  
License MIT
Crystal 0.29.0

Authors

Dependencies 0

Development Dependencies 0

Dependents 1

Last synced .
search fire star recently