lib/exodus/helpers/text_formatter.rb
def stringify_paragraph
      ordered_lines = {}

      spaces = @full_text.map {|column, lines| lines.max_by {|sentence| sentence.size}.size}
      @full_text.each_with_index do |(column, lines), i| 
        lines.each_with_index do |line, line_number|
          if line == "/nbspace"
            (ordered_lines[line_number] ||= "") << line.gsub("/nbspace", "-" * (spaces[i] + 4))
          else
            (ordered_lines[line_number] ||= "") << line.to_s.ljust(spaces[i] + 4)
          end
        end
      end

      ordered_lines.values.join("\n")
    end
def stringify_paragraph
      ordered_lines = {}

      spaces = @full_text.map {|column, lines| lines.max_by {|sentence| sentence.size}.size}
      @full_text.each_with_index do |(column, lines), i| 
        lines.each_with_index do |line, line_number|
          if line == "/nbspace"
            (ordered_lines[line_number] ||= "") << line.gsub("/nbspace", "-" * (spaces[i] + 4))
          else
            (ordered_lines[line_number] ||= "") << line.to_s.ljust(spaces[i] + 4)
          end
        end
      end

      ordered_lines.values.join("\n")
    end
Creates a String from a Hash of the following format {column_number => [lines]}
 "/nbspace" is used to define a border