Commit Graph
11 Commits
Author SHA1 Message Date
Mike McQuaid 20851b9c01 Add Jenkins version matching (and test). 2012-10-16 10:31:35 +01:00
Mike McQuaid 580180bffe erlang: fix version detection and bottles. 2012-08-25 10:21:48 -07:00
Jack Nagel 672696b086 Version: make MacOSVersion comparison more robust
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 18:16:08 -05:00
Jack Nagel 6ccf2aa253 Version: build-in devel version comparisons
The heuristic used by the default version comparison is simple. A
version string is scanned for strings of digits, split into an array of
these strings, and then an element-wise comparison is done.

This fails when presented with something like

  Version.new("1.0.0beta7") <=> Version.new("1.0.0")

because the first three digits match, and the fourth digit of the
receiver (7) is greater than the assumed fourth digit of the parameter
(0).

Fix this by defining an element-wise comparator on a new VersionElement
class. This allows us to correctly compare "alpha", "beta", and "rc"
style version strings, and keeps the logic out of the main version
comparison.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 15:53:04 -05:00
Jack Nagel 822aeac407 Add custom comparator for MacOS.version
This will allow us to do comparisons like

  if MacOS.version >= :lion

and hopefully deprecate the MacOS.<name>? family of methods, which are
counterinitutive.
2012-08-18 11:13:54 -05:00
Jack Nagel 610c65c908 Add small DSL for defining comparators 2012-08-18 11:12:10 -05:00
Jack Nagel db7a800130 Add support for custom version schemes
A version scheme is a class that inherits from Version and reimplements
Version#<=>. This will allow formulae to specify a custom comparison
method that will be used instead of the default, for cases where the
default is insufficient.
2012-08-18 11:12:09 -05:00
Jack Nagel 9e80ec2c11 Add Version#detected_from_url? 2012-08-18 11:12:09 -05:00
Jack Nagel acd2866bbc Move version detection to Version class
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:12:07 -05:00
Jack Nagel 966f555e65 Initial version comparison implementation
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:12:07 -05:00
Jack Nagel 35b0647697 Add Version class 2012-08-18 11:12:07 -05:00