From 75b38f18940764f048ded4a3938407566152cbee Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sat, 20 Mar 2021 23:48:10 -0700 Subject: [PATCH] [ruby/irb] Fix step's argument cols.size was calling Integer#size, which returns 8. Fixing a bug of https://github.com/ruby/irb/pull/209 https://github.com/ruby/irb/commit/c93ae4be71 --- lib/irb/cmd/ls.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/irb/cmd/ls.rb b/lib/irb/cmd/ls.rb index 07e6fbc487..87798a22d7 100644 --- a/lib/irb/cmd/ls.rb +++ b/lib/irb/cmd/ls.rb @@ -64,7 +64,7 @@ module IRB def col_widths(strs, cols:) cols.times.map do |col| - (col...strs.size).step(cols.size - 1).map do |i| + (col...strs.size).step(cols).map do |i| strs[i].length end.max end