Sha256: 8e0d257c1818a12a3d85c286dd33e0cb3a0c25bddaf0bf3fd94fd28c72720a2e

Contents?: true

Size: 543 Bytes

Versions: 2

Compression:

Stored size: 543 Bytes

Contents

require_relative "abstract"

module TTY
  class Command
    module Printers
      class Progress < Abstract
        def print_command_exit(cmd, status, runtime, *args)
          output.print(success_or_failure(status))
        end

        def write(*)
        end

        private

        # @api private
        def success_or_failure(status)
          if status == 0
            decorate(".", :green)
          else
            decorate("F", :red)
          end
        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/progress.rb
tty-command-0.10.0 lib/tty/command/printers/progress.rb