lib/sample_cmdlet_patterns/commands/progress_bar_byte_per_second.rb
# Execute ProgressBarBytePerSecond subcommand taking input from
# a input stream and writing to output stream
#
# sample: output.puts 'OK'
Execute ProgressBarBytePerSecond subcommand taking input from
a input stream and writing to output stream


Execute ProgressBarBytePerSecond subcommand taking input from a input stream and writing to output stream
def execute(input: $stdin, output: $stdout)
        prompt.ok('Bytes per Second')
        bar = TTY::ProgressBar.new("[:bar] :byte_rate/s") do |config|
          config.total = 3000
          config.interval = 1     
        end
        3000.times do
          sleep(0.001)
          bar.advance
        end
        :gui
      end
def execute ( input : $stdin , output : $stdout ) prompt . ok ( 'Bytes per Second' ) bar = TTY :: ProgressBar . new ( "[:bar] :byte_rate/s" ) do | config | config . total = 3000 config . interval = 1 end 3000 . times do sleep ( 0.001 ) bar . advance end :gui end
Execute ProgressBarBytePerSecond subcommand taking input from
a input stream and writing to output stream
Execute ProgressBarBytePerSecond subcommand taking input from a input stream and writing to output stream
# => 1 sec
input
output