Class: Ndo::Process
- Inherits:
-
Struct
- Object
- Struct
- Ndo::Process
- Defined in:
- lib/ndo/popen.rb
Instance Attribute Summary collapse
-
#pid ⇒ Object
Returns the value of attribute pid.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdin ⇒ Object
Returns the value of attribute stdin.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Instance Method Summary collapse
Instance Attribute Details
#pid ⇒ Object
Returns the value of attribute pid
3 4 5 |
# File 'lib/ndo/popen.rb', line 3 def pid @pid end |
#stderr ⇒ Object
Returns the value of attribute stderr
3 4 5 |
# File 'lib/ndo/popen.rb', line 3 def stderr @stderr end |
#stdin ⇒ Object
Returns the value of attribute stdin
3 4 5 |
# File 'lib/ndo/popen.rb', line 3 def stdin @stdin end |
#stdout ⇒ Object
Returns the value of attribute stdout
3 4 5 |
# File 'lib/ndo/popen.rb', line 3 def stdout @stdout end |
Instance Method Details
#close_all ⇒ Object
14 15 16 17 |
# File 'lib/ndo/popen.rb', line 14 def close_all [stdin, stdout, stderr]. each(&:close) end |
#status ⇒ Object
4 5 6 7 |
# File 'lib/ndo/popen.rb', line 4 def status wait unless @status @status end |
#success? ⇒ Boolean
11 12 13 |
# File 'lib/ndo/popen.rb', line 11 def success? status.success? end |
#wait ⇒ Object
8 9 10 |
# File 'lib/ndo/popen.rb', line 8 def wait _, @status = ::Process.waitpid2(pid) end |