Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Before this patch the `SemVer#[]` method uses a `proc` to pre-process
version strings, which seems a bit unnecessary when a method would do.
This patch replaces the `proc` with the `SemVer#pre` method and updates
the related specs.
|
|
|
|
In Ruby 1.9 Range's implementation of include? changed so that if the
objects being compared were non-numeric it would iterate over them
instead of doing a comparison with the endpoints. We're subclassing
numeric to force non-discrete range behavior.
Numeric doesn't allow singleton methods to be defined, so we had to
change the way inspect worked when dealing with MIN and MAX values.
Paired-with: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
Having range intersection allows easier checking of version constraints,
and new comparson operators allow for ranged version constraints like
you would expect from a typical packaging system (ex 1.2.x).
There is also a slight change to the way prerelease version numbers are
validated so that a dash is required between the patch version and
prerelease string. This was done to comply with the declared semver
spec:
A pre-release version number MAY be denoted by appending an arbitrary
string immediately following the patch version and a dash
This could affect forge module versions, or face versions, but neither
of these were found to be using prerelease versioning anyway.
Pieter van de Bruggen was the original author of these changes, but I'm
submitting them as part a larger rebase for module tool change. I've
also reviewed the changes.
|
|
This introduces a class representing a semantic version, and
implementing a few of the most common uses of them: validation,
comparison, and finding the greatest available version matching
a range. This refactoring also allows us to easily expand our
matching of version ranges in the future, which is a big plus.
Reviewed-By: Daniel Pittman
|