summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-10-01 10:58:33 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-10-12 16:46:31 +0200
commit95e9bd9651e718b06a6cf468a275db71dd2f8952 (patch)
treed32e4cdab0cb2e8588d52af4413cd9a03c9deb4e
parent0c9aeb96fb1e263830de65f335f1c091da06a7c1 (diff)
downloadbundler-95e9bd9651e718b06a6cf468a275db71dd2f8952.tar.gz
Move row justification logic to a method
-rw-r--r--lib/bundler/cli/outdated.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index f04c875273..826bcdfe90 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -266,11 +266,7 @@ module Bundler
data.sort_by! {|row| row[0] }
data.each do |row|
- row = row.each_with_index.map do |element, index|
- element.ljust(column_sizes[index])
- end
-
- Bundler.ui.info row.join(" ") + "\n"
+ Bundler.ui.info justify(row, column_sizes)
end
end
@@ -279,5 +275,11 @@ module Bundler
header << "Path" if options[:verbose]
header
end
+
+ def justify(row, sizes)
+ row.each_with_index.map do |element, index|
+ element.ljust(sizes[index])
+ end.join(" ") + "\n"
+ end
end
end