Method: String#do_format_output_bullet_detail

Defined in:
lib/format_output/bullets.rb

#do_format_output_bullet_detail(input, body, pad) ⇒ Object

Do the formatting legwork. Returns: An array of strings.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/format_output/bullets.rb', line 87

def do_format_output_bullet_detail(input, body, pad)
  buffer, build, empty = [], "", false

  # Grab "words" of input, splitting off lines as needed.
  # Note: This loop exits when input.next runs out of data.
  loop do
    build = build.format_output_split_if_over(buffer, body, pad, input.next)
                 .format_output_split_if_huge(buffer, body, pad)

    empty = build.empty?
  end

  unless empty
    buffer << pad + build
  end

  buffer
end