diff options
| author | Misty De Meo | 2013-06-06 09:26:20 -0500 |
|---|---|---|
| committer | Misty De Meo | 2013-06-06 09:26:40 -0500 |
| commit | 92d65aace7edfc751c342c019e895d33bbea013c (patch) | |
| tree | c2afb6a271769e9da1f5ebee00b682a5927586c6 /Library | |
| parent | 515578723ed5a6c910ddcad773d5a0d6373602b1 (diff) | |
| download | brew-92d65aace7edfc751c342c019e895d33bbea013c.tar.bz2 | |
linkapps: replace #max_by with #max
Enumerable#max_by didn't exist in 1.8.6, so linkapps failed on Leopard.
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/Contributions/cmd/brew-linkapps.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Contributions/cmd/brew-linkapps.rb b/Library/Contributions/cmd/brew-linkapps.rb index cf394b479..ce3f4960a 100755 --- a/Library/Contributions/cmd/brew-linkapps.rb +++ b/Library/Contributions/cmd/brew-linkapps.rb @@ -13,7 +13,7 @@ HOMEBREW_CELLAR.subdirs.each do |rack| kegs = rack.subdirs.map { |d| Keg.new(d) } next if kegs.empty? - keg = kegs.detect(&:linked?) || kegs.max_by(&:version) + keg = kegs.detect(&:linked?) || kegs.max {|a,b| a.version <=> b.version} Dir["#{keg}/*.app", "#{keg}/bin/*.app", "#{keg}/libexec/*.app"].each do |app| puts "Linking #{app}" |
