Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

rootstrap/rsgem

Repository files navigation

rsgem - Rootstrap's gem generator

Gem Version ci Maintainability Test Coverage

rsgem is a tool to help you start developing gems with the defaults we use at Rootstrap.

Installation

$ gem install rsgem

We highly suggest to not include rsgem in your Gemfile. rsgem is not a library, and should not affect the dependency tree of your project.

Usage

rsgem new NAME

RSGem will solve the following tasks for you:

  1. Create a folder for your gem leveraging bundler's defaults. (You need bundler in your system)
  2. Add the following dependencies:
  3. Add configuration files for Reek and Rubocop with default Rootstrap's configuration.
  4. Add a rake task to run Rubocop and Reek by calling rake code_analysis.
  5. Clean the Gemfile.
  6. Git ignore the Gemfile.lock
  7. Add a CI provider configuration. GitHub Actions and Travis are available providers. Travis is the default.
  8. Set the bundled files to be a short list of files. By default the gem will bundle:
    • LICENSE.txt
    • README.md
    • lib/**/* (everything inside lib)
  9. Apply Rubocop style fixes

Examples

rsgem new foo

Creates a new gem called foo.

rsgem new bar --ci=github_actions

Creates a new gem called bar that uses Github Actions as the CI provider.

rsgem new foo_bar --bundler=--ext

Creates a new gem called foo_bar and passes the --ext flag to bundler.

rsgem new bar_foo --bundler='--several --flags'

Creates a new gem passing several flags to bundler.

Help

rsgem -h

Displays global help.

rsgem new -h

Displays help for the new command.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bundle exec rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To 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.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rootstrap/rsgem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

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

Code of Conduct

Everyone interacting in the Rootstrap project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.