Class: ProcessOutputWrapper::Command
- Inherits:
-
Object
- Object
- ProcessOutputWrapper::Command
- Defined in:
- lib/process_output_wrapper/command.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(command) ⇒ Command
constructor
A new instance of Command.
- #whenever(&blk) ⇒ Object
Constructor Details
#initialize(command) ⇒ Command
Returns a new instance of Command.
3 4 5 6 7 |
# File 'lib/process_output_wrapper/command.rb', line 3 def initialize(command) @command = command @line = "" @print_normally = false end |
Instance Method Details
#execute ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/process_output_wrapper/command.rb', line 9 def execute if ENV['VERBOSE'] == 'true' execute_normally else execute_wrapped end end |
#whenever(&blk) ⇒ Object
17 18 19 20 21 |
# File 'lib/process_output_wrapper/command.rb', line 17 def whenever(&blk) Whenever.new(&blk).tap do |w| conditionals << w end end |