Method: Autobuild::ProgressDisplay#display_progress

Defined in:
lib/autobuild/progress_display.rb

#display_progress(consider_period: true) ⇒ Object



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/autobuild/progress_display.rb', line 188

def display_progress(consider_period: true)
    return unless progress_enabled?
    return if consider_period && (@next_progress_display > Time.now)

    formatted = format_grouped_messages(
        @progress_messages.map(&:last),
        indent: "  "
    )
    if @progress_mode == :newline
        @io.print formatted.join("\n")
        @io.print "\n"
    else
        @io.print @cursor.clear_screen_down
        @io.print formatted.join("\n")
        @io.print @cursor.up(formatted.size - 1) if formatted.size > 1
        @io.print @cursor.column(0)
    end
    @io.flush
    @next_progress_display = Time.now + @progress_period
end