Toys template for gems, like building, releasing, etc.
Add this line to your application's Gemfile:
gem 'gem_toys'
And then execute:
bundle install
Or install it yourself as:
gem install gem_toys
# .toys.rb
require 'gem_toys'
expand GemToys::Template,
## default is `CHANGELOG.md`
changelog_file_name: 'ChangeLog.md',
## default is `## Unreleased`
unreleased_title: '## main (unreleased)',
## default is `"lib/#{project_name_with_slashes_instead_dashes}/version.rb"`
version_file_path: 'lib/my-awesome_gem.rb',
## default is `v`, so tags are like `v4.1.0`
version_tag_prefix: ''
# `gem` namespace created, aliases are optional, but handful
alias_tool :g, :gem
toys gem build
builds a gem with the current version and move it to the pkg/
directory.
toys gem install
builds a gem and install it locally.
toys gem release
does:
- Update
lib/*gem_name*/version.rb
file. Can be refined with:version_file_path
option onexpand
. - Insert Markdown title with changes from
## Unreleased
in aCHANGELOG.md
file. Can be refined with:unreleased_title
option onexpand
. - Builds a gem.
- Ask you for manual check, if you want (print anything of OK).
You also can change manually a content of
CHANGELOG.md
, for example, before committing. - Commit these files.
- Tag this commit with
vX.Y.Z
. - Push git commit and tag.
- Push the new gem.
After checking out the repo, run bundle install
to install dependencies.
Then, run toys rspec
to run the tests.
To install this gem onto your local machine, run toys gem install
.
To release a new version, run toys gem release %version%
. See how it works here.
Bug reports and pull requests are welcome on GitHub.
The gem is available as open source under the terms of the MIT License.