mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
9074613927
Before this commit the following snippet didn't work: pry(main)> Pry::Helpers.tablify(['foobar', 'baz'], 5) #=> FloatDomainError There was a divison by zero in `Helpers::Table#_recolumn`. The problem is incorrectly written `until` loop condition. Note that the longest element in the array has 6 characters. But the second argument tells `::tablify` that the line width is only 5 characters long. This commit changes the condition. Now, if you run the same snippet, you would see that the elements form one column (and the code doesn't blow up your program). Possibly, in the described case, the table has unwanted blanks. However, I'm not very competent in the code, so I'd better not touch it, because it works. |
||
---|---|---|
.. | ||
base_helpers.rb | ||
command_helpers.rb | ||
documentation_helpers.rb | ||
options_helpers.rb | ||
table.rb | ||
text.rb |