Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/postmodern/ruby-cli-boilerplate
Zero-dependency Ruby CLI boilerplate code
https://github.com/postmodern/ruby-cli-boilerplate
boilerplate boilerplate-code cli example-code ruby
Last synced: 23 days ago
JSON representation
Zero-dependency Ruby CLI boilerplate code
- Host: GitHub
- URL: https://github.com/postmodern/ruby-cli-boilerplate
- Owner: postmodern
- License: mit
- Created: 2022-11-29T16:12:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-29T20:19:45.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T19:45:34.089Z (about 1 month ago)
- Topics: boilerplate, boilerplate-code, cli, example-code, ruby
- Language: Ruby
- Homepage:
- Size: 5.86 KB
- Stars: 59
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# ruby-cli-boilerplate
This repository contains a boilerplate Ruby CLI class that can be used to
implement a basic zero-dependency CLI for other Ruby libraries.## Features
* Zero-dependencies, making it ideal for adding a CLI to small libraries.
* Correctly handles `Ctrl^C` and broken pipe exceptions.
* Catches any other exceptions and prints a bug report.
* Defines the CLI as a class, making it easy to test.
* Comes with boilerplate RSpec tests.## Other CLI libraries
If you want to build a CLI for a large Ruby app or framework, and
don't mind adding an extra dependency for a CLI library/framework, I recommend
the following Ruby CLI libraries:* [cmdparse](https://cmdparse.gettalong.org/)
* [dry-cli](https://dry-rb.org/gems/dry-cli/)
* [command_kit](https://github.com/postmodern/command_kit.rb#readme)