22644c9c08c809e0ec1d6a272668c3f70c4ecda1
Dev Initial commit

Dev authored 7 years ago

1) require 'open3'
2) 
3) module RCM
4) 
5)   def cmd(command)
6)     stdin, stdout, stderr, wait_thr = Open3.popen3(command)
7)     output = stdout.gets(nil)
8)     stdout.close
Dev Refactoring. Adding pkg mgmt.

Dev authored 7 years ago

9)     error = stderr.gets(nil)
Dev Initial commit

Dev authored 7 years ago

10)     stderr.close
11)     exit_code = Integer(wait_thr.value)
12) 
13)     {
14)       exit_code: exit_code,
15)       output: output,
Dev Refactoring. Adding pkg mgmt.

Dev authored 7 years ago

16)       error: error
Dev Initial commit

Dev authored 7 years ago

17)     }
18) 
19)   end
Dev Refactoring. Adding pkg mgmt.

Dev authored 7 years ago

20) 
21)   module_function :cmd