Sha256: f520a6cf83dee3d2f669cf11aef001663a7110e089e17871dca12fff64723c8c

Contents?: true

Size: 815 Bytes

Versions: 3

Compression:

Stored size: 815 Bytes

Contents

module PhotoMosaic
  class ProgressBar
    def image_import(event)
      @image_count ||= event[:paths].size
      @import_progress_bar ||= ::ProgressBar.create(
        total: @image_count,
        length: 150,
        format: "%a %e %P% Processed: %c/%C %t"
      )
      @import_progress_bar.title = "Importing tile images: " + event[:current_path]
      @import_progress_bar.increment
      system("clear") if @import_progress_bar.finished?
    end

    def image_find_match(event)
      @mosaic_size ||= event[:total]
      @mosaic_progress_bar ||= ::ProgressBar.create(
        total: @mosaic_size,
        length: 150,
        format: "%a %e %P% Processed: %c/%C tiles %t: |\e[0;34m%B\e[0m|"
      )
      @mosaic_progress_bar.title = "Finding matches"
      @mosaic_progress_bar.increment
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
photo_mosaic-0.1.5 lib/photo_mosaic/progress_bar.rb
photo_mosaic-0.1.4 lib/photo_mosaic/progress_bar.rb
photo_mosaic-0.1.3 lib/photo_mosaic/progress_bar.rb