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_relative 'result'
|
5 all except jruby-9.1.1.0 ✔ |
5 |
|
|
6 |
module TTY |
5 all except jruby-9.1.1.0 ✔ |
7 |
class Command |
5 all except jruby-9.1.1.0 ✔ |
8 |
class DryRunner |
5 all except jruby-9.1.1.0 ✔ |
9 |
attr_reader :cmd
|
5 all except jruby-9.1.1.0 ✔ |
10 |
|
|
11 |
def initialize(cmd, printer) |
5 all except jruby-9.1.1.0 ✔ |
12 |
@cmd = cmd
|
15 all except jruby-9.1.1.0 ✔ |
13 |
@printer = printer
|
15 all except jruby-9.1.1.0 ✔ |
14 |
end
|
|
15 |
|
|
16 |
# Show command without running
|
|
17 |
#
|
|
18 |
# @api public
|
|
19 |
def run!(*) |
5 all except jruby-9.1.1.0 ✔ |
20 |
cmd.to_command |
15 all except jruby-9.1.1.0 ✔ |
21 |
message = "#{@printer.decorate('(dry run)', :blue)} " +
|
15 all except jruby-9.1.1.0 ✔ |
22 |
@printer.decorate(cmd.to_command, :yellow, :bold) |
|
23 |
@printer.write(message, cmd.uuid)
|
15 all except jruby-9.1.1.0 ✔ |
24 |
Result.new(0, '', '') |
15 all except jruby-9.1.1.0 ✔ |
25 |
end
|
|
26 |
end # DryRunner |
|
27 |
end # Command |
|
28 |
end # TTY |