130 Commits

Author SHA1 Message Date
Misty De Meo
d32a1c4c7d Version: add #to_f
This is used by things which used to compare against raw strings,
for example Xcode.uncached_version
2016-11-10 15:09:36 -08:00
Misty De Meo
16529a4de5 Version: allow coercing non-versions in comparisons
These are needed due to the raw string and fixnum comparisons which
exist for legacy reasons, for instance compiler version and build
comparisons.
2016-11-10 15:08:36 -08:00
Misty De Meo
b6acb9cb47 Version: allow comparing against nil 2016-11-10 15:08:36 -08:00
Misty De Meo
fbcf500a48 Version.parse: return Version::NULL for unparseable strings 2016-11-10 15:08:36 -08:00
Misty De Meo
9bac107b31 Add Version::NULL singleton 2016-11-10 15:08:36 -08:00
Mike McQuaid
5b4b7b24e6 version: don't let a/b imply alpha/beta.
This is assumption is broken for at least OpenSSL which makes it a
bad general rule.

As discussed in #1102.
2016-09-24 17:40:37 +01:00
Markus Reiter
e2c7509065 Merge pull request #1113 from reitermarkus/rubocop-guardclause
RuboCop: Fix Style/GuardClause.
2016-09-24 17:38:49 +02:00
Markus Reiter
58e36c7319 Fix Style/GuardClause. 2016-09-24 12:24:35 +02:00
Zhiming Wang
687f0fcf72 Merge pull request #1102 from zmwangx/alpha-rc-detection
version: improve alpha and rc detection (elasticsearch)
2016-09-24 05:53:17 -04:00
Markus Reiter
e851c9bf6c Style/Alias: Prefer alias. 2016-09-23 18:19:53 +02:00
Markus Reiter
b5f8de8bf4 Fix Style/RegexpLiteral. 2016-09-23 15:30:07 +02:00
Markus Reiter
52ff988530 Fix RuboCop CaseEquality. 2016-09-23 15:30:06 +02:00
Zhiming Wang
58a2ef9b58
version: improve alpha and rc detection 2016-09-23 06:23:36 -04:00
Mike McQuaid
6693915399 rubocop --auto-correct all remaining files.
But remove some manual `.freeze`s on constants that shouldn't be
constants.
2016-09-17 16:14:13 +01:00
ilovezfs
a5a1b2969f version: fix parsing of URLs ending with version
https://github.com/lihaoyi/Ammonite/releases/download/0.7.4/0.7.4

was parsing as "0.7" not "0.7.4" since ".4" was being treated as a
legitimate file extension. At minimum, let's insist that a valid file
extension include at least one letter to avoid lopping off part of the
correct version string.
2016-08-18 06:51:02 -07:00
Vlad Shablinsky
80489dcb49
version: introduce HeadVersion 2016-07-16 20:39:13 +08:00
Xu Cheng
de1049f1f1
various: proper escape dot in regex 2016-07-13 19:11:46 +08:00
Andrew Janke
798c342f4e brew pull: cross-platform bottle verification, concise output (#132)
Do the bottle check using any platform's bottle, so `brew pull` works
on bottled formulae which don't include a bottle for the current system.

Make output more concise and informative
 * Remove expected download error messages when waiting for Bintray publishing
 * Replace patch download progress bars with patch file name
 * Silence git output about switching to and from bottle-pulling branch
 * Include formula name and patch type in some progress messages
2016-05-03 08:22:28 -04:00
Alex Dunn
f15532452e version: correctly parse codeload URLs
Needed for Homebrew/homebrew#49346.

Closes Homebrew/homebrew#49354.

Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
2016-02-19 17:36:42 -08:00
Baptiste Fontaine
4c5aee7a56 version: fix GitHub releases URLs parsing
The current code doesn't work with releases that have more than one
digit in the third group, i.e.:

  .../releases/download/1.2.3/...  works
  .../releases/download/1.2.34/... doesn't work

Closes Homebrew/homebrew#49255.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-17 13:23:26 +01:00
Xiyue Deng
e1dfafa54c Improve dash separated version detection.
* Also with test case.

Closes Homebrew/homebrew#47584.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-02 20:06:17 +01:00
Stefano Pigozzi
e865cee3d3 Fix version parsing on URLs with no extensions 2015-12-26 21:47:14 +00:00
Baptiste Fontaine
cc7a047edc version: parse opam archives
Closes Homebrew/homebrew#44544.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-10-04 10:31:46 +02:00
Xu Cheng
b121e5fd7b more core file style updated by rubocop 2015-08-06 17:23:56 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Jack Nagel
9b75afcf4a Make Version#<=> allocation-free 2015-03-27 20:07:50 -04:00
Jack Nagel
38a8c54898 Return early for the == case in Version#<=> 2015-03-17 21:37:03 -04:00
Jack Nagel
68c7e1e30c Add protected reader for version value 2015-03-17 21:37:03 -04:00
Jack Nagel
03b309cc76 Fix NullToken equality 2015-03-17 21:37:03 -04:00
Jack Nagel
0d4f241d48 Remove explicit type check 2015-03-17 21:37:03 -04:00
Jack Nagel
2356131e5f Remove unnecessary default argument
This method is always called with two arguments.
2015-03-14 01:58:17 -04:00
Baptiste Fontaine
a9c4091de7 Fix more version misdetections for URLs with archs
Closes Homebrew/homebrew#36368.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-01-30 08:55:49 +00:00
Baptiste Fontaine
a9e8dfb996 Fix version misdetections for URLs with OS/archs
Closes Homebrew/homebrew#36308.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-01-28 14:19:21 +00:00
Jack Nagel
4bbefc12e3 Eliminate boolean argument to Version.new 2015-01-07 15:21:20 -05:00
Jack Nagel
35793f0e0c Let Version.parse instantiate subclasses 2015-01-07 15:21:20 -05:00
Viktor Szakats
fc2818b7a5 Use more https in urls and updated some lost links
Closes Homebrew/homebrew#35531.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-01-04 02:13:16 -05:00
Jack Nagel
dfb7657557 Compare patchlevels numerically rather than lexically
Fixes Homebrew/homebrew#32960.
2014-10-06 13:55:23 -05:00
Jack Nagel
fbefa76ce2 Always use class.name to build inspect strings 2014-07-01 18:39:15 -05:00
Jack Nagel
f446e95852 Remove support for version "schemes", just pass version objects directly
I'm not sure why I thought reinventing object instantiation was a good
idea.
2014-05-27 21:41:43 -05:00
Jack Nagel
33c99123f2 Build the version scanner regexp once 2014-04-03 11:19:57 -05:00
Jack Nagel
0f5a80a97b Fix tokenizing openssl style versions
Fixes Homebrew/homebrew#25736.
2014-01-11 20:00:34 -06:00
Jack Nagel
b6cbd08e93 Implement hash equality for Version 2013-12-09 19:43:07 -06:00
Mike McQuaid
8d256848d6 version: match Jenkins LTS releases. 2013-11-14 22:58:24 +00:00
Jack Nagel
383b321119 Disallow initializing Versions with non-strings
Closes Homebrew/homebrew#23553.
2013-10-25 17:29:45 -05:00
Mike McQuaid
705a248719 versions: remove perforce bottle detection. 2013-08-03 22:27:42 -07:00
Jack Nagel
023aff10c7 Adjust logic to properly sort erlang versions
Fixes Homebrew/homebrew#21417.
2013-07-24 19:48:21 -05:00
Jack Nagel
033ef09518 Detect versions in tag specs
Closes Homebrew/homebrew#18300.
Closes Homebrew/homebrew#20891.
2013-06-28 21:17:23 -05:00
Jack Nagel
74b60a561c Simplify custom version scheme handling 2013-06-28 21:17:12 -05:00
Mike McQuaid
01e5e428eb perforce: add version detection regex. 2013-06-20 13:07:59 +01:00
Jack Nagel
113125d394 Remove Version#to_a alias
Exposing this as "to_a" was a mistake, versions are not arrays and it
causes incorrect behavior when splatted or using Kernel#Array(). Use the
more correct name "tokens" instead.
2013-06-14 18:37:27 -05:00