diff options
| author | Mike McQuaid | 2015-12-07 13:11:34 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2015-12-07 14:56:30 +0000 |
| commit | bf2315b1f4ae0cb7c9bb80b651ef6389f66020b2 (patch) | |
| tree | 5e155d3b7869721b2ce260c2d8229154745ce5a8 /Library/Homebrew/cmd/update.rb | |
| parent | d603c03aa3dac553124d09e1e2b78dff8f408284 (diff) | |
| download | brew-bf2315b1f4ae0cb7c9bb80b651ef6389f66020b2.tar.bz2 | |
Use `(installed)` and emoji ticks consistently.
Across info, search and update.
Closes Homebrew/homebrew#45131.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/cmd/update.rb')
| -rw-r--r-- | Library/Homebrew/cmd/update.rb | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb index 6ee2726a9..f4cd9d712 100644 --- a/Library/Homebrew/cmd/update.rb +++ b/Library/Homebrew/cmd/update.rb @@ -455,30 +455,20 @@ class Report end def dump_formula_report(key, title) - formula = select_formula(key) - unless formula.empty? - # Determine list item indices of installed formulae. - formula_installed_index = formula.each_index.select do |index| - name, newname = formula[index] - installed?(name) || (newname && installed?(newname)) - end - - # Format list items of renamed formulae. + formula = select_formula(key).map do |name, new_name| + # Format list items of renamed formulae if key == :R - formula.map! { |oldname, newname| "#{oldname} -> #{newname}" } - end - - # Append suffix '(installed)' to list items of installed formulae. - formula_installed_index.each do |index| - formula[index] += " (installed)" + new_name = pretty_installed(new_name) if installed?(name) + "#{name} -> #{new_name}" + else + installed?(name) ? pretty_installed(name) : name end + end - # Fetch list items of installed formulae for highlighting. - formula_installed = formula.values_at(*formula_installed_index) - + unless formula.empty? # Dump formula list. ohai title - puts_columns(formula, formula_installed) + puts_columns(formula) end end |
