ruby-changes:65610
From: Takashi <ko1@a...>
Date: Sun, 21 Mar 2021 15:51:07 +0900 (JST)
Subject: [ruby-changes:65610] 75b38f1894 (master): [ruby/irb] Fix step's argument
https://git.ruby-lang.org/ruby.git/commit/?id=75b38f1894 From 75b38f18940764f048ded4a3938407566152cbee Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Sat, 20 Mar 2021 23:48:10 -0700 Subject: [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 07e6fbc..87798a2 100644 --- a/lib/irb/cmd/ls.rb +++ b/lib/irb/cmd/ls.rb @@ -64,7 +64,7 @@ module IRB https://github.com/ruby/ruby/blob/trunk/lib/irb/cmd/ls.rb#L64 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 -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/