{"id":17599216,"url":"https://github.com/shanecav84/sphyg","last_synced_at":"2025-03-29T21:12:10.391Z","repository":{"id":56896610,"uuid":"115774544","full_name":"shanecav84/sphyg","owner":"shanecav84","description":"'Sphygmos' is the Greek word for 'pulse'. Sphyg provides an interface for creating throbbers to indicate that your long-running command line program still has a pulse.","archived":false,"fork":false,"pushed_at":"2022-01-11T17:31:52.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T11:28:00.348Z","etag":null,"topics":["cli","ruby","spinner","throbber"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shanecav84.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-30T04:52:26.000Z","updated_at":"2022-01-11T17:31:07.000Z","dependencies_parsed_at":"2022-08-21T01:50:11.144Z","dependency_job_id":null,"html_url":"https://github.com/shanecav84/sphyg","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanecav84%2Fsphyg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanecav84%2Fsphyg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanecav84%2Fsphyg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanecav84%2Fsphyg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shanecav84","download_url":"https://codeload.github.com/shanecav84/sphyg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246243553,"owners_count":20746311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","ruby","spinner","throbber"],"created_at":"2024-10-22T10:24:27.573Z","updated_at":"2025-03-29T21:12:10.371Z","avatar_url":"https://github.com/shanecav84.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sphyg\n\n'Sphygmos' is the Greek word for 'pulse'. Sphyg provides an interface for\ncreating [throbbers](https://en.wikipedia.org/wiki/Throbber) to indicate that\nyour long-running command line program still has a pulse.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'sphyg'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install sphyg\n\n## Usage\n\nPass the _message_ you want to display while your command is running\nand a _block_ containing your long-running command to `Sphyg.pulse`.\n\n```ruby\n\u003e ::Sphyg.pulse('Please wait') { sleep }\nPlease wait ⡀ ⠄ ⠂ ⠁ ⠂ ⠄ # animated \n```\n\n### Options\n\nYou can also pass an _options_ hash to `::Sphyg.pulse` to customize the displayed\nthrobber. A throbber consists of an array of _frames_, an _enumerator_, and a\n_rate_. The following are built-in throbbers. You may use the `:kind` key to \nchoose a built-in throbber, or utilize `::Sphyg::THROBBERS` to configure them.\n\n#### `:kind`\n\nConfigure which kind of throbber you would like to use. Available kinds and their associated frames:\n\n| Kind | Frames |\n| ---- | ------ |\n| `:ascii` | \\| / - \\ |\n| `:elipsis` | . .. ... .. |\n| `:heart` | ❤ 🧡 💛 💚 💙 💜 |\n| `:heroku` | ⣾ ⣽ ⣻ ⢿ ⡿ ⣟ ⣯ ⣷ |\n| `:moon` | 🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘 |\n| `:time` | 🕛 🕐 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚 |\n| `:wave` | ⡀ ⠄ ⠂ ⠁ ⠂ ⠄ |\n\n#### `:frames`\n\nAn array of strings from which to choose to display.\n\n#### `:enumerator`\n\nThe string name of an object that is used to generate successive frames\nto display. Must receive an array of strings, which will be set to an instance\nvariable, `@frames`. Must respond to `#next`. For example:\n\n```ruby\nRandomizer = Struct.new(:frames) { def next; @frames.sample; end }\noptions = {\n  frames: %w[a b c],\n  enumerator: 'Randomizer',\n  rate: 0.1\n}\n\u003e Sphyg.pulse('Please wait', options) { sleep }\nPlease wait a # Will display a random value from `frames` every 0.1 seconds alongside the message\n\n```\n\nSee [`Sphyg::Enumerators`](lib/sphyg/enumerators) for more examples.\n\n#### `:rate`\n\nAn `Integer` or `Float` representing the 'frame' rate of the throbber in \nseconds. Sphyg will cycle through the enumerator at this value.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nRun `bundle exec rake` to lint and run tests.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/shanecav84/sphyg. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Sphyg project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/shanecav84/sphyg/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanecav84%2Fsphyg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshanecav84%2Fsphyg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanecav84%2Fsphyg/lists"}