Module: Kernel

Defined in:
lib/webget_commander.rb

Instance Method Summary collapse

Instance Method Details

#commander(command, args = {}) ⇒ Object

Spawn a command with Open4::spawn

Optional args are the same as Open4::spawn (stdin, stdout, stderr).

Return status, stdout, stderr



32
33
34
35
36
37
38
# File 'lib/webget_commander.rb', line 32

def commander(command,args={}) #=> status exit code, stdout string, stderr string
 stdin=args['stdin']||nil
 stdout=args['stdout']||''
 stderr=args['stderr']||''
 status = Open4::spawn(command,'stdin'=>stdin,'stdout'=>stdout,'stderr'=>stderr)
 return status,stdout,stderr
end