From ec784efcd1072793b12a206efbc0a20024db3ed8 Mon Sep 17 00:00:00 2001 From: Gavin Laking Date: Sun, 27 Sep 2015 14:19:36 +0100 Subject: [PATCH] Minor tidyup. --- lib/vedeu/output/wordwrap.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/vedeu/output/wordwrap.rb b/lib/vedeu/output/wordwrap.rb index 851e6f850..3467a5eaa 100644 --- a/lib/vedeu/output/wordwrap.rb +++ b/lib/vedeu/output/wordwrap.rb @@ -38,19 +38,15 @@ def content def prune return text if text.size <= pruned_width - processed = [] - - if split_lines.size > 1 - processed = split_lines.reduce([]) do |acc, line| + processed = if split_lines.size > 1 + split_lines.reduce([]) do |acc, line| acc << ellipsis_string(line) end else - processed = ellipsis_string(text) + ellipsis_string(text) end - - processed end # @return [String] @@ -75,9 +71,7 @@ def wrap processed << reformatted end - processed.reduce([]) do |output, line| - output << line.join(' ') - end + processed.reduce([]) { |output, line| output << line.join(' ') } end protected