17 Commits
Author SHA1 Message Date
Markus Reiter 24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter 425cc76da9 Refactor and document PkgVersion. 2020-08-20 05:31:40 +02:00
Seeker f904cc2aea pkg_version: disable rubocop hash alignment 2020-08-11 13:15:50 -07:00
Seeker 51bc9ae3d9 pkg_version: delegate major, minor, patch methods to :version 2020-08-11 13:01:54 -07:00
Mike McQuaidandGitHub 57fd98ec4f pkg_version: tweak variable naming. 2020-03-04 11:28:28 +00:00
David Frascone 8ed8d6979c Fix for when version is nil
When version is nil, (version <==> other.version) also returns nil
and then the nill object doesn't have a nonzero? method.

I'm not sure what package put me into this state, but, this fix repaired
my environment.

Also, there is probably a more ruby-esque way to do this, but, I'm not a
ruby expert ;-)
2020-03-03 12:27:21 -07:00
Mike McQuaid 36dbad3922 Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid 737b84b54b brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Markus Reiter e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid cf5fdeef1d Rubocop: manual rule fixes. 2017-09-24 21:23:59 +01:00
Markus Reiter e851c9bf6c Style/Alias: Prefer alias. 2016-09-23 18:19:53 +02:00
Markus Reiter 52ff988530 Fix RuboCop CaseEquality. 2016-09-23 15:30:06 +02:00
Vlad ShablinskyandXu Cheng 2e916110e4 Use HeadVersion for install/reinstall 2016-07-16 20:39:13 +08:00
Vlad ShablinskyandXu Cheng 9ac5836604 pkg_version: allow HeadVersion and HEAD revisions 2016-07-16 20:39:13 +08:00
Jack Nagel 27092cabc4 Switch PkgVersion to use composition
Comparing PkgVersion and Version objects can produce nonsensical
results. For example, equality is not symmetric:

irb(main):002:0> PkgVersion.new("1.0", 0) == Version.new("1.0")
=> false
irb(main):003:0> Version.new("1.0") == PkgVersion.new("1.0", 0)
=> true

Rather than attempt to deal with subclass-superclass equality, let's use
composition and punt on the problem altogether.
2015-04-02 20:22:12 -04:00
Jack Nagel 1ee4cd94ba Fix PkgVersion#<=> 2014-07-03 16:37:43 -05:00
Jack Nagel 6008187d5f Encode formula revision in installation prefix
In order to allow kegs built with the same version but differing formula
revisions to coexist, we must encode the revision as part of the keg's
name. This is necessary to actually perform an upgrade, as we cannot
upgrade a keg in-place, and temporarily moving it pending the result of
the upgrade is error-prone and potentially slow.

To accomplish this, we introduce a new Formula#pkg_version method that
concatenates the active_spec version with the formula revision. An
exception is made for a formula that has no revision: the tag is
omitted. This preserves compatibility with existing installations.
2014-03-05 20:12:51 -06:00