outdated: always do comparisons with a Formula as the receiver

It is possible for the object returned by Formula#version to be a
subclass of Version with special behavior, so we want to use that for
the comparison.
This commit is contained in:
Jack Nagel 2013-05-14 20:11:46 -05:00
parent e0c4fd5b72
commit 8b763acc2a

View File

@ -16,7 +16,7 @@ module Homebrew extend self
def outdated_brews def outdated_brews
Formula.installed.map do |f| Formula.installed.map do |f|
kegs = f.rack.subdirs.map { |d| Keg.new(d) } kegs = f.rack.subdirs.map { |d| Keg.new(d) }
unless kegs.any? { |keg| keg.version >= f.version } if kegs.all? { |k| f.version > k.version }
yield f if block_given? yield f if block_given?
f f
end end