19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/convoy/formatter/stream_output_formatter.rb', line 19
def print(string)
splitter_input = pad_string_to_account_for_cursor_position(string.to_s)
segments = StringSplitter.new(max_output_width).split(splitter_input)
segments = remove_padding_that_account_for_cursor_position(segments)
segments.each do |segment|
output_string = "#{current_indent_string}#{segment}"
output_string = segment unless cursor_position.newline?
stream.print output_string
cursor_position.update_for(segment)
newline if segments.last != segment
end
end
|