summaryrefslogtreecommitdiff
path: root/lib/bundler/cli
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-10-01 11:01:03 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-10-12 16:46:32 +0200
commita65304f0da902cbbad775d0fb46dc939ebb4961d (patch)
tree70dec1d58c79d5c2357ff988874ce48cd7acf685 /lib/bundler/cli
parenteb47767be21e36b8d456c7788155e9cb91e6db85 (diff)
downloadbundler-a65304f0da902cbbad775d0fb46dc939ebb4961d.tar.gz
Don't include table header when ordering
Diffstat (limited to 'lib/bundler/cli')
-rw-r--r--lib/bundler/cli/outdated.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index 926794da9e..242d60b629 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -265,13 +265,16 @@ module Bundler
version_section.to_a[0].to_i
end
- def print_indented(data)
- columns = data.first.size
+ def print_indented(matrix)
+ header = matrix[0]
+ data = matrix[1..-1]
- column_sizes = Array.new(columns) do |index|
- data.max_by {|row| row[index].length }[index].length
+ column_sizes = Array.new(header.size) do |index|
+ matrix.max_by {|row| row[index].length }[index].length
end
+ Bundler.ui.info justify(header, column_sizes)
+
data.sort_by! {|row| row[0] }
data.each do |row|