33 Commits

Author SHA1 Message Date
Mike McQuaid
df2cdc681a Add Apache version style test. 2013-01-01 17:30:57 +00:00
Mike McQuaid
7d61bfe88f Add another Erlang version format. 2012-12-16 14:35:41 +00:00
Mike McQuaid
425440de3b Add Jenkins version matching (and test). 2012-10-16 10:31:35 +01:00
Mike McQuaid
d9a18d4c1e erlang: fix version detection and bottles. 2012-08-25 10:21:48 -07:00
Jack Nagel
f069ebd0df Version: make MacOSVersion comparison more robust
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 18:16:08 -05:00
Jack Nagel
3081e69783 Test version interrogation methods
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 16:07:14 -05:00
Jack Nagel
23cc14f9a1 Simplify version comparison tests
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 16:03:43 -05:00
Jack Nagel
c924de7086 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
b8231fc5f3 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
329f0a8490 Replace version strings with Version objects 2012-08-18 11:12:08 -05:00
Jack Nagel
43dc54e8b9 Further version test refactoring 2012-08-18 11:12:08 -05:00
Jack Nagel
5fe7fdf153 Move version detection to Version class
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:12:07 -05:00
Jack Nagel
956c1d653a Initial version comparison implementation
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:12:07 -05:00
Jack Nagel
969ce2f67d Preliminary version test refactoring 2012-08-18 11:12:07 -05:00
Jack Nagel
f5eaef0aee Deprecate ancient formula syntax
Closes Homebrew/homebrew#13444.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-09 23:56:54 -05:00
Jack Nagel
93f8c71e21 tests: clean up whitespace
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel
90dbb8a141 Prune some requires from test files
testing_env already requires utils; set up the ARGV and ENV extensions
there as well.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Mike McQuaid
ebe4e07fa3 Change versioned bottle syntax and fix issues.
Fixed Homebrew/homebrew#11562.
2012-04-24 18:53:45 +10:00
Mike McQuaid
4138d30428 Revert "Change versioned bottle syntax and fix issues."
This reverts commit f80908bead8b620ebcc5cdde9de65e70598002b6.
2012-04-24 18:10:08 +10:00
Mike McQuaid
40370e05bd Change versioned bottle syntax and fix issues.
Fixed Homebrew/homebrew#11562.
2012-04-24 18:08:14 +10:00
Jack Nagel
d3ba9723b2 Add test for ghc version style
the ghc formula had an explicit version because we had trouble parsing
the version from the 64-bit URL. It is working now, so add a test to
ensure it isn't broken in the future.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-06 00:08:23 -05:00
Jack Nagel
8973d1dbcf Remove redundant versions and update version tests
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-11 15:18:56 -05:00
Mike McQuaid
4a306f32f4 Support bottles for non-Lion OSX versions. 2012-03-10 18:09:35 +13:00
Max Howell
9a774ac0a6 Fix libinet version detection 2012-01-14 03:48:03 +00:00
Jack Nagel
27d2a95e8f Correctly parse ImageMagick bottle version
Commit 2695821e98 ("Only use the bottle if its version is up-to-date")
essentially broke the ImageMagick bottle, because the version parsing
logic returns "1" as the bottle version.

Fixing this requires only a slight modification to the bottle URL regex;
includes a test.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-21 17:29:14 -05:00
Mike McQuaid
23769d62ad Fix brew bottle versioning. 2011-06-21 19:04:17 +01:00
Austin Ziegler
007b9e72d5 Adding version detection to sf.net /download urls
SourceForge links can end with /download which appears to be part of
what is used to drive mirror selection. Modifying the version detection
extension of pathname.rb to detect this case for both sourceforge.net
and sf.net download selections.

This is sufficient for version detection but may not be sufficient for
other uses of /download links. I have not found any problems with links
that use /download, though.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-03-25 22:30:10 -07:00
lukas
bd6fb10361 Fixed recognition of versions like 'foobar-4.50-beta' in Pathname#version
Sphinx currently has a download name 'http://sphinxsearch.com/downloads/sphinx-1.10-beta.tar.gz', which homebrew currently can't correctly identify - with a small change to the regex for 'foobar-4.5.0-beta1' (make that trailing number optional) - it works like a charm.

Signed-off-by: David Höppner <0xffea@gmail.com>
2010-08-27 17:53:06 +02:00
Adam Vandenberg
375f8094d3 Add debian style names to version checker. 2010-07-06 13:17:50 -07:00
Adam Vandenberg
4ae8029557 Update version tests 2010-07-06 13:17:43 -07:00
Adam Vandenberg
4c2a8a7f1c Move version tests to separate file. 2010-04-06 08:27:11 -07:00
Joshua Peek
04855ddd48 fix github version parser with multidigit number
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2010-03-27 14:01:19 -07:00
Adam Vandenberg
a309403d8a Update test suite.
* Break single test case class into several test cases.
* Fix broken arch test.
* Make update tests optional (seem to only work for mxcl).
* Add more tests.
* Move fixtures to separate folder.
2010-02-02 09:08:10 -08:00