lib/sample_cmdlet_patterns/commands/progress_bar.rb
# Execute ProgressBar command taking input from a input stream
# and writing to output stream
#
# sample: output.puts 'OK'
Execute ProgressBar command taking input from a input stream
and writing to output stream


Execute ProgressBar command taking input from a input stream and writing to output stream
def execute(input: $stdin, output: $stdout)
        loop do
          case @subcommand
          when :gui
            gui
          when :simple
            require_relative 'progress_bar_simple'
            subcmd = SampleCmdletPatterns::Commands::ProgressBarSimple.new({})
          when :twin
            require_relative 'progress_bar_twin'
            subcmd = SampleCmdletPatterns::Commands::ProgressBarTwin.new({})
          when :colorful
            require_relative 'progress_bar_colorful'
            subcmd = SampleCmdletPatterns::Commands::ProgressBarColorful.new({})
          when :byte_per_second
            require_relative 'progress_bar_byte_per_second'
            subcmd = SampleCmdletPatterns::Commands::ProgressBarBytePerSecond.new({})
          else
            break
          end
          @subcommand = subcmd&.execute(input: input, output: output)
        end
      end
def execute ( input : $stdin , output : $stdout ) loop do case @subcommand when :gui gui when :simple require_relative 'progress_bar_simple' subcmd = SampleCmdletPatterns :: Commands :: ProgressBarSimple . new ( { } ) when :twin require_relative 'progress_bar_twin' subcmd = SampleCmdletPatterns :: Commands :: ProgressBarTwin . new ( { } ) when :colorful require_relative 'progress_bar_colorful' subcmd = SampleCmdletPatterns :: Commands :: ProgressBarColorful . new ( { } ) when :byte_per_second require_relative 'progress_bar_byte_per_second' subcmd = SampleCmdletPatterns :: Commands :: ProgressBarBytePerSecond . new ( { } ) else break end @subcommand = subcmd &. execute ( input : input , output : output ) end end
Execute ProgressBar command taking input from a input stream
and writing to output stream
Execute ProgressBar command taking input from a input stream and writing to output stream
input
output