summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup/to_rdoc.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/markup/to_rdoc.rb')
-rw-r--r--lib/rdoc/markup/to_rdoc.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rdoc/markup/to_rdoc.rb b/lib/rdoc/markup/to_rdoc.rb
index 88234f5096..90763ccfdb 100644
--- a/lib/rdoc/markup/to_rdoc.rb
+++ b/lib/rdoc/markup/to_rdoc.rb
@@ -249,8 +249,8 @@ class RDoc::Markup::ToRdoc < RDoc::Markup::Formatter
# Adds +table+ to the output
def accept_table header, body, aligns
- widths = header.zip(body) do |h, b|
- [h.size, b.size].max
+ widths = header.zip(*body).map do |cols|
+ cols.map(&:size).max
end
aligns = aligns.map do |a|
case a
@@ -262,12 +262,12 @@ class RDoc::Markup::ToRdoc < RDoc::Markup::Formatter
:rjust
end
end
- @res << header.zip(widths, aligns) do |h, w, a|
+ @res << header.zip(widths, aligns).map do |h, w, a|
h.__send__(a, w)
end.join("|").rstrip << "\n"
@res << widths.map {|w| "-" * w }.join("|") << "\n"
body.each do |row|
- @res << row.zip(widths, aligns) do |t, w, a|
+ @res << row.zip(widths, aligns).map do |t, w, a|
t.__send__(a, w)
end.join("|").rstrip << "\n"
end