Commit 98a36c60 authored by Olivier Halligon's avatar Olivier Halligon

Get rid of `tap` (/cc @alloy)

parent a14568c4
...@@ -193,20 +193,20 @@ module Pod ...@@ -193,20 +193,20 @@ module Pod
# #
def labeled(label, value, justification = 16) def labeled(label, value, justification = 16)
if value if value
''.tap do |t| title = "- #{label}:".ljust(justification)
t << " - #{label}:".ljust(justification) output = begin
if value.is_a?(Array) if value.is_a?(Array)
indent = self.indentation_level + 2 lines = [wrap_string(title, self.indentation_level)]
puts_indented t << "\n" lines << value.map do |v|
value.each do |v| wrap_string("- #{v}", self.indentation_level + 2)
t << wrap_string(" - #{v}\n", indent).tap do |line|
puts line
end << "\n"
end end
lines.join("\n")
else else
puts_indented t << value.to_s << "\n" wrap_string(title + "#{value}", self.indentation_level)
end end + "\n"
end end
puts output
output
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment