Sha256: 4e4111614a3744d1376326597c7701d37e0756d5079fa553a8cd82b9e0b9c2ca

Contents?: true

Size: 831 Bytes

Versions: 2

Compression:

Stored size: 831 Bytes

Contents

require_relative "abstract"

module TTY
  class Command
    module Printers
      class Quiet < Abstract
        def print_command_start(cmd)
          # quiet
        end

        def print_command_out_data(cmd, *args)
          write(cmd, args.join(" "), out_data)
        end

        def print_command_err_data(cmd, *args)
          write(cmd, args.join(" "), err_data)
        end

        def print_command_exit(cmd, status, *args)
          unless !cmd.only_output_on_error || status.zero?
            output << out_data
            output << err_data
          end

          # quiet
        end

        def write(cmd, message, data = nil)
          target = (cmd.only_output_on_error && !data.nil?) ? data : output
          target << message
        end
      end # Progress
    end # Printers
  end # Command
end # TTY

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tty-command-0.10.1 lib/tty/command/printers/quiet.rb
tty-command-0.10.0 lib/tty/command/printers/quiet.rb