Sha256: 275c507a927d381b8139791abcc5dbd5e62774e35c7cdd553251464a8b7842c1

Contents?: true

Size: 580 Bytes

Versions: 4

Compression:

Stored size: 580 Bytes

Contents

# = progressbar.rb
#
# @author Rodrigo Fernández
#
# == Módulo Progressbar
# Este módulo se encarga de mostrar una barra de progreso

require 'ruby-progressbar'

module Liri
  module Common
    module Progressbar
      class << self
        def start(params = {})
          @compressing = true
          progressbar = ProgressBar.create(params)
          Thread.new do
            while @compressing
              progressbar.increment
              sleep(0.1)
            end
          end
          yield
          @compressing = false
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
liri-0.3.1 lib/common/progressbar.rb
liri-0.3.0 lib/common/progressbar.rb
liri-0.2.1 lib/common/progressbar.rb
liri-0.2.0 lib/common/progressbar.rb