Skip to content

Create Ruby gems with an interactive CLI wizard, which remembers your choices! No more `bundle gem` flags look-ups πŸ™Œ

License

Notifications You must be signed in to change notification settings

svyatov/create-ruby-gem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

create-ruby-gem Gem Version CI

Create Ruby gems with an interactive CLI wizard, which remembers your choices!
No more bundle gem flags look-ups πŸ™Œ

Table of Contents

Supported Versions

Ruby 3.2+ and Bundler 2.4+ are required.

Installation

gem install create-ruby-gem

Quick Start

create-ruby-gem my_awesome_gem

The wizard detects your Ruby and Bundler versions, walks you through every supported option, shows a summary of the bundle gem command it will run, and lets you edit or confirm before executing.

Interactive Wizard

Running create-ruby-gem <name> starts the step-by-step wizard:

  1. Version detection β€” detects Ruby, RubyGems, and Bundler versions at runtime.
  2. Option filtering β€” shows only options your Bundler version supports (see Compatibility Matrix).
  3. Smart defaults β€” uses your last-used choices as defaults, falling back to Bundler's own settings.
  4. Back-navigation β€” press Ctrl+B to revisit the previous step.
  5. Summary β€” displays the exact bundle gem command with color-coded arguments.
  6. Edit-again loop β€” choose "edit again" to change options, or "create" to execute.
  7. Preset save prompt β€” after creation, optionally save your choices as a named preset.

Press Ctrl+C at any time to exit.

Preset System

Save, load, and manage option presets:

# Save options as a preset during gem creation
create-ruby-gem my_gem --save-preset oss-defaults

# Create a gem using a saved preset (non-interactive)
create-ruby-gem my_gem --preset oss-defaults

# List all saved presets
create-ruby-gem --list-presets

# Show a preset's options
create-ruby-gem --show-preset oss-defaults

# Delete a preset
create-ruby-gem --delete-preset oss-defaults

Compatibility Matrix

Options available depend on your Bundler version. The wizard automatically hides unsupported options.

Option Bundler 2.4–2.x Bundler 3.x Bundler 4.x
--exe / --no-exe βœ“ βœ“ βœ“
--coc / --no-coc βœ“ βœ“ βœ“
--changelog / --no-changelog β€” βœ“ βœ“
--ext c c c, go, rust
--git βœ“ βœ“ βœ“
--github-username βœ“ βœ“ βœ“
--mit / --no-mit βœ“ βœ“ βœ“
--test minitest, rspec, test-unit minitest, rspec, test-unit minitest, rspec, test-unit
--ci circle, github, gitlab circle, github, gitlab circle, github, gitlab
--linter β€” rubocop, standard rubocop, standard
--edit βœ“ βœ“ βœ“
--bundle / --no-bundle βœ“ βœ“ βœ“

Configuration

Config is stored at ~/.config/create-ruby-gem/config.yml (or $XDG_CONFIG_HOME/create-ruby-gem/config.yml).

The file contains:

  • version β€” schema version (currently 1)
  • last_used β€” the options from your most recent gem creation
  • presets β€” named option sets saved via --save-preset or the post-creation prompt

CLI Reference

Flag Description
<name> Gem name (prompted interactively if omitted)
--preset NAME Use a saved preset (non-interactive)
--save-preset NAME Save the selected options as a preset
--list-presets List all saved preset names
--show-preset NAME Show a preset's options
--delete-preset NAME Delete a saved preset
--dry-run Print the bundle gem command without executing
--bundler-version VERSION Override the detected Bundler version
--doctor Print runtime versions and supported options
--version Print the create-ruby-gem version

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bundle exec rake to run the tests and linter. You can also run bin/console for an interactive prompt.

bundle exec rake          # tests + rubocop (default task)
bundle exec rake spec     # tests only
bundle exec rake yard     # generate YARD docs into doc/
exe/create-ruby-gem            # run the CLI locally

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Make your changes and run tests (bundle exec rake)
  4. Commit using Conventional Commits format (git commit -m 'feat: add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request

Changelog

See CHANGELOG.md for a detailed history of changes, following Keep a Changelog format.

Versioning

This project follows Semantic Versioning 2.0.0.

License

The gem is available as open source under the terms of the MIT License.

About

Create Ruby gems with an interactive CLI wizard, which remembers your choices! No more `bundle gem` flags look-ups πŸ™Œ

Topics

Resources

License

Stars

Watchers

Forks