Sha256: 5e7ff34f3ca8af7809ed7763a7cad79524a4c0060a5c751e9cd10c2241e32b55

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 KB

Contents

# coding: utf-8

module TTY
  class ProgressBar
    class Formatter
      extend Forwardable

      def_delegators :@pipeline, :decorate, :use

      # @api private
      def initialize(pipeline = nil)
        @pipeline = pipeline || TTY::ProgressBar::Pipeline.new
      end

      # Prepare default pipeline formatters
      #
      # @api private
      def load
        @pipeline.use TTY::ProgressBar::CurrentFormatter
        @pipeline.use TTY::ProgressBar::TotalFormatter
        @pipeline.use TTY::ProgressBar::TotalByteFormatter
        @pipeline.use TTY::ProgressBar::ElapsedFormatter
        @pipeline.use TTY::ProgressBar::EstimatedFormatter
        @pipeline.use TTY::ProgressBar::PercentFormatter
        @pipeline.use TTY::ProgressBar::ByteFormatter
        @pipeline.use TTY::ProgressBar::ByteRateFormatter
        @pipeline.use TTY::ProgressBar::RateFormatter
        @pipeline.use TTY::ProgressBar::MeanRateFormatter
        @pipeline.use TTY::ProgressBar::MeanByteFormatter
        @pipeline.use TTY::ProgressBar::BarFormatter
      end
    end # Formatter
  end # ProgressBar
end # TTY

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tty-progressbar-0.10.1 lib/tty/progressbar/formatter.rb
tty-progressbar-0.10.0 lib/tty/progressbar/formatter.rb
tty-progressbar-0.9.0 lib/tty/progressbar/formatter.rb
tty-progressbar-0.8.1 lib/tty/progressbar/formatter.rb
tty-progressbar-0.8.0 lib/tty/progressbar/formatter.rb
tty-progressbar-0.7.0 lib/tty/progressbar/formatter.rb
tty-progressbar-0.6.0 lib/tty/progressbar/formatter.rb