0.01
No commit activity in last 3 years
No release in over 3 years
Ensure your gems are appropriately versioned
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 0.1.1
~> 10.0
~> 3.0
~> 1.2
~> 0.87.1

Runtime

>= 0.5
~> 2.0
 Project Readme

StrongVersions

Overview

StrongVersions enforces a strict policy on your Gemfile requirements:

  • The pessimistic ~> operator must be used for all gem requirement definitions.
  • If the gem version is greater than 1, the requirement format must be major.minor, e.g. '~> 2.5'
  • If the gem version is less than 1, the requirement format must be major.minor.patch, e.g. '~> 0.8.9'
  • A lower/upper bound can be specified as long as a valid pessimistic version is also specified, e.g. '~> 8.4', '< 8.6.7'
  • All gems with a path or git source are ignored, e.g. path: '/path/to/gem', git: 'https://github.com/bobf/strong_versions'
  • All gems specified in the ignore list are ignored.

Any gems that do not satisfy these rules will be included in the StrongVersions output with details on why they did not meet the standard.

When all gems in a Gemfile follow this convention it SHOULD always be safe to run bundle update (assuming all gems adhere to Semantic Versioning).

StrongVersions

Installation

Add the gem to your Gemfile

gem 'strong_versions', '~> 0.4.5'

And rebuild your bundle:

$ bundle install

Usage

StrongVersions is invoked with a provided executable:

$ bundle exec strong_versions

The executable will output all non-passing gems and will return an exit code of 1 on failure, 0 on success (i.e. all gems passing). This makes StrongVersions suitable for use in a continuous integration pipeline:

StrongVersions

Auto-correct is available with the -a/--auto-correct option:

$ bundle exec strong_versions -a

Exclusions

You can tell StrongVersions to ignore any of your gems (e.g. those that don't follow semantic versioning) by adding them to the ignore section of .strong_versions.yml in your project root, e.g.:

# .strong_versions.yml
ignore:
  - rails

Gems in the ignore list will not be updated when using the -a/--auto-correct option.

Contributing

Fork and create a pull request.

Run tests with RSpec:

$ bin/rspec

Check code with Rubocop:

$ bin/rubocop

License

MIT License