Class: Proclib::Commands::Local
- Inherits:
-
Base
- Object
- Base
- Proclib::Commands::Local
show all
- Defined in:
- lib/proclib/commands/local.rb
Constant Summary
Constants inherited
from Base
Base::NotYetRunning, Base::NotYetTerminated
Instance Method Summary
collapse
Instance Method Details
#spawn ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/proclib/commands/local.rb', line 7
def spawn
spawn = -> do
pipes.stdin, pipes.stdout, pipes.stderr, @wait_thread = Open3.popen3(env, cmdline)
end
if run_dir
Dir.chdir(run_dir) { spawn.call }
else
spawn.call
end
end
|
#wait ⇒ Object
19
20
21
|
# File 'lib/proclib/commands/local.rb', line 19
def wait
@result ||= wait_thread.value.to_i
end
|