Class: TTY::Command::DryRunner
- Inherits:
-
Object
- Object
- TTY::Command::DryRunner
- Defined in:
- lib/tty/command/dry_runner.rb
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
Instance Method Summary collapse
-
#initialize(cmd, printer) ⇒ DryRunner
constructor
A new instance of DryRunner.
-
#run! ⇒ Object
Show command without running.
Constructor Details
permalink #initialize(cmd, printer) ⇒ DryRunner
Returns a new instance of DryRunner.
10 11 12 13 |
# File 'lib/tty/command/dry_runner.rb', line 10 def initialize(cmd, printer) @cmd = cmd @printer = printer end |
Instance Attribute Details
permalink #cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
8 9 10 |
# File 'lib/tty/command/dry_runner.rb', line 8 def cmd @cmd end |
Instance Method Details
permalink #run! ⇒ Object
Show command without running
18 19 20 21 22 23 24 |
# File 'lib/tty/command/dry_runner.rb', line 18 def run!(*) cmd.to_command = "#{@printer.decorate("(dry run)", :blue)} " + @printer.decorate(cmd.to_command, :yellow, :bold) @printer.write(cmd, , cmd.uuid) Result.new(0, "", "") end |