travis-ci
7 of 7 new or added lines in 1 file covered. (100.0%)
496 of 548 relevant lines covered (90.51%)
70.99 hits per line
1 |
# encoding: utf-8
|
|
2 |
# frozen_string_literal: true
|
|
3 |
|
|
4 |
require 'pastel'
|
5 all except jruby-9.1.1.0 ✔ |
5 |
require_relative 'abstract'
|
5 all except jruby-9.1.1.0 ✔ |
6 |
|
|
7 |
module TTY |
5 all except jruby-9.1.1.0 ✔ |
8 |
class Command |
5 all except jruby-9.1.1.0 ✔ |
9 |
module Printers |
5 all except jruby-9.1.1.0 ✔ |
10 |
class Progress < Abstract |
5 all except jruby-9.1.1.0 ✔ |
11 |
|
|
12 |
def print_command_exit(cmd, status, runtime, *args) |
5 all except jruby-9.1.1.0 ✔ |
13 |
output.print(success_or_failure(status)) |
10 all except jruby-9.1.1.0 ✔ |
14 |
end
|
|
15 |
|
|
16 |
def write(*) |
5 all except jruby-9.1.1.0 ✔ |
17 |
end
|
|
18 |
|
|
19 |
private |
5 all except jruby-9.1.1.0 ✔ |
20 |
|
|
21 |
# @api private
|
|
22 |
def success_or_failure(status) |
5 all except jruby-9.1.1.0 ✔ |
23 |
if status == 0 |
10 all except jruby-9.1.1.0 ✔ |
24 |
decorate('.', :green) |
5 all except jruby-9.1.1.0 ✔ |
25 |
else
|
|
26 |
decorate('F', :red) |
5 all except jruby-9.1.1.0 ✔ |
27 |
end
|
|
28 |
end
|
|
29 |
end # Progress |
|
30 |
end # Printers |
|
31 |
end # Command |
|
32 |
end # TTY |