This is how RubyGems Semantic Versioning with Pessimistic version constraint works
gem "rails", "~> 7.0.4" # means >= 7.0.4 and < 7.1
Semantic versioning boils down to:
- PATCH
0.0.xlevel changes for implementation level detail changes, such as small bug fixes- MINOR
0.x.0level changes for any backwards compatible API changes, such as new functionality/features- MAJOR
x.0.0level changes for backwards incompatible API changes, such as changes that will break existing users code if they update
If you use a version specifier like "~> 7.0.4" bundler will always pick the latest patch of the given version 7.0 of the gem.
Most of the version specifiers, like
>= 1.0, are self-explanatory. The specifier~>has a special meaning, best shown by example.~> 2.0.3is identical to>= 2.0.3and< 2.1.~> 2.1is identical to>= 2.1and< 3.0.~> 2.2.betawill match prerelease versions like2.2.beta.12.~> 0is identical to>= 0.0and< 1.0.