Class: Ellipses::Support::Shell::Runner
- Inherits:
-
Object
- Object
- Ellipses::Support::Shell::Runner
- Defined in:
- lib/ellipses/support/shell.rb
Overview
Adapted to popen3 from github.com/mina-deploy/mina
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #run(*args) ⇒ Object
Constructor Details
#initialize ⇒ Runner
Returns a new instance of Runner.
28 29 30 |
# File 'lib/ellipses/support/shell.rb', line 28 def initialize @coathooks = 0 end |
Instance Method Details
#run(*args) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/ellipses/support/shell.rb', line 32 def run(*args) return dummy_result if args.empty? out, err, status = Open3.popen3(*args) do |_, stdout, stderr, wait_thread| block(stdout, stderr, wait_thread) end Result.new args, out, err, status.exitstatus end |