Sha256: 56d06193e7a6ba3e43562dd6cf7d7dbfb6fd42b5dbed36ed902872580f57504f

Contents?: true

Size: 889 Bytes

Versions: 6

Compression:

Stored size: 889 Bytes

Contents

# encoding: utf-8

require_relative 'abstract'

module TTY
  class Command
    module Printers
      class Quiet < Abstract
        attr_reader :output, :options

        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

6 entries across 6 versions & 2 rubygems

Version Path
outstand-tty-command-0.10.0 lib/tty/command/printers/quiet.rb
outstand-tty-command-0.10.0.pre lib/tty/command/printers/quiet.rb
tty-command-0.9.0 lib/tty/command/printers/quiet.rb
tty-command-0.8.2 lib/tty/command/printers/quiet.rb
tty-command-0.8.1 lib/tty/command/printers/quiet.rb
tty-command-0.8.0 lib/tty/command/printers/quiet.rb