Class: Flaky::Cmd
- Inherits:
-
Object
- Object
- Flaky::Cmd
- Defined in:
- lib/flaky/appium.rb
Instance Attribute Summary collapse
-
#err ⇒ Object
readonly
Returns the value of attribute err.
-
#in ⇒ Object
readonly
Returns the value of attribute in.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
Instance Method Summary collapse
-
#initialize(cmd) ⇒ Cmd
constructor
A new instance of Cmd.
- #stop ⇒ Object
Constructor Details
#initialize(cmd) ⇒ Cmd
Returns a new instance of Cmd.
7 8 9 10 |
# File 'lib/flaky/appium.rb', line 7 def initialize cmd @pid, @in, @out, @err = POSIX::Spawn::popen4 cmd @in.close end |
Instance Attribute Details
#err ⇒ Object (readonly)
Returns the value of attribute err.
5 6 7 |
# File 'lib/flaky/appium.rb', line 5 def err @err end |
#in ⇒ Object (readonly)
Returns the value of attribute in.
5 6 7 |
# File 'lib/flaky/appium.rb', line 5 def in @in end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
5 6 7 |
# File 'lib/flaky/appium.rb', line 5 def out @out end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
5 6 7 |
# File 'lib/flaky/appium.rb', line 5 def pid @pid end |
Instance Method Details
#stop ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/flaky/appium.rb', line 12 def stop [@in, @out, @err].each { |io| io.close unless io.nil? || io.closed? } begin Process.kill 'KILL', @pid Process.waitpid @pid rescue # no such process end end |