aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorJack Nagel2012-08-18 13:34:31 -0500
committerJack Nagel2012-08-18 15:53:04 -0500
commitc924de7086e793661cd3ef1a62f6d0175a42b8d4 (patch)
tree97aa397628c68211f1cf4a1ac56176f8c4dfacc3 /Library/Homebrew/cmd
parenta119ee718d00c7dab4e06f5e0ce156212f7f5b45 (diff)
downloadbrew-c924de7086e793661cd3ef1a62f6d0175a42b8d4.tar.bz2
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>
Diffstat (limited to 'Library/Homebrew/cmd')
0 files changed, 0 insertions, 0 deletions