Treat the people that use your gem like royalty! Send for a gouteur before serving them something new!
This gem runs the build tasks of other projects against your unreleased changes.
Sometimes, other projects start depending on your gem.
When you release a new version of your gem, these projects might break.
Semantic versioning obviously helps. People make mistakes, though. The boundary between public and private APIs can also be fuzzy, particularly in an open language like Ruby.
Thus, when you update your gem, you might feel as if you should check whether things that depend on it will keep working before you release the new version.
Gouteur automates this step.
Add gouteur to the development dependencies of your gem.
Create a .gouteur.yml in the root of your project:
repos:
- uri: https://github.com/someone/some_gem
ref: some_specific_branch # optional, default is the default branch
before: setup_special_dependency # optional, bundle is always installed
tasks: ['rspec', 'rake foo'] # optional, default is `rake`
name: cool_gem # optional, defaults to repo name from uri, e.g. `some_gem`
locked: true # optional, prevents setting an incompatible VERSION
force: true # optional, forces test even if VERSION is incompatibleThen simply bundle exec gouteur or add the rake task to your Rakefile:
require 'gouteur/rake_task'
Gouteur::RakeTask.new
# default name is :gouteur, e.g. to include it in the default task:
task default: %i[rspec gouteur]Pro tip: for large repos, running only relevant specs can speed up things a lot, e.g.:
tasks: 'rspec spec/known_relevant_spec.rb'tasks: 'rspec --pattern "**/{,*}{keyword1,keyword2}{,*,*/**/*}_spec.rb"'`From the shell:
# example: check one dependent repo
gouteur 'https://github.com/foo/bar'
# see other usage options:
gouteur --helpFrom Ruby:
repo = Gouteur::Repo.new(uri: 'https://github.com/foo/bar')
success, message = Gouteur::Checker.call(repo)Bug reports and pull requests are welcome on GitHub at https://github.com/jaynetics/gouteur.
Possible future improvements:
- consider caching of dependent repositories in CI, e.g. in GitHub workflows
- support more sources of code, e.g. latest release, private GitHub repositories
- improve performance by tracing & rerunning only specs/tests that use the gem
- save time in MiniTest by forcing it to run in fail-fast mode like RSpec
- other ideas? open an issue!
The gem is available as open source under the terms of the MIT License.