Class: ProcessOutputWrapper::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/process_output_wrapper/command.rb

Instance Method Summary collapse

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

#executeObject



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